User Role Conditional Logic

How to use:

There are two different classes of users to consider when using this plugin.

  1. The user who is submitting the form for the first time (creator of the form entry).
  2. The person who is viewing or editing the entry (editor).

This plugin works for both single – role and multi – role setups.

Please note that this plugin is primarily designed to be used on forms that are filled out by users on the front end. Using this plugin on the backend when editing forms could produce unexpected results.

To use and store the roles of the user submitting the form:

Add the hidden (AUTO) User Roles field to your form. This field will not be shown to users submitting the form and can not be modified.

Once this hidden field has been added to your form, the options will show up in your conditional logic as if they were a standard checkbox field.

After submitting a form, this plugin will calculate the conditional logic based on the actual role/s of the user on the backend rather than hidden submitted values. (This is the most secure way to check roles as it prevents spoofing).

To show/hide a field based on the role(s) of the user viewing/editing the form (advanced)

For this method, use the “(Current User Roles)” option in the conditional logic of the form.

Do not use this option unless you fully understand the difference between submitter and viewer. The rules you set with this option could potentially affect previously submitted fields if you apply them while editing an already submitted entry. (e.g. administrator editing an entry submitted by a customer).