How do I make a field show or hide based on a User's Role?

Created by Joshua Miller, Modified on Mon, 24 Mar at 10:21 PM by Joshua Miller

Step-by-step guide

  1. Select the Module link in the top left banner then select the appropriate module name link.
  2. Select the Forms tab.
  3. Then select the Field List button "Create/Update Fields".
  4. Select the field that you want to conditionally show or hide.
  5. Select the Edit pencil icon  on the field.
  6. In the Display Condition Field enter a Custom JavaScript expression like the examples below that evaluates True when the field should show:

    Example- Show for "example-role", "module admin", and "tenant admin" use the below conditions
    isInRole('example-role') || isInRole('module admin' ) || isInRole('tenant admin')

    Example- Not show for a specific role, use the below condition
    !isInRole('example-role')

  7. Once you have entered all desired options click the Update button and then click Save on the Field List.
  8. To test, load the request form as the respective roles to ensure the field either shows or does not show as desired.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article