Top
How to display pop-ups based on user roles?
  • 02 Aug 2023
  • 1 Minute To Read
  • Dark
    Light
  • PDF

How to display pop-ups based on user roles?

  • Dark
    Light
  • PDF

Article Summary

Pop-ups can be configured to display only to a specific set of users based on role/segment using the window variable option. These values for the window variable need to be made available from your application.

Use the following steps to set the visibility rule using window variable,

  1. On the Whatfix Guidance dashboard, click Widgets.
    ia_left_nav_widgets

  2. Click All widgets.
    ia_widgets_all_widgets

  3. Click Create widget.
    CLM_DB_CreateWidget.png

  1. Click Popup.
    CLM_create popup

  2. Enter a name and content for the Pop-up, and then click the Set Visibility Rules → button.
    set_visibility_rules

  3. Under the Where tab, select Window Variable from the dropdown.
    window_variable

  4. Enter the Variable name, select Equals operator, and then enter the Variable value.
    window_variable_user_roles

your title goes here

Your application developers can help you get the variable name and its value.

  1. The following example uses Window Variable to identify user roles. You can use different methods that fits with your app structure.
Using URL Parameter

If you're passing role permission in the URL parameters, the following method can be used.

RB_popup_VR_param_admin

Using URL Hash

If you're passing role permission in the URL Hash, the following method can be used.

RB_popup_VR_hash_admin

Using Elements in a page

If each role has a unique element available in the app, you can use it to display pop-ups. For example, the Settings icon is only visible to Admin users, Request Access button is available only to Editors . Use these element to identify the user and dispaly content.

RB_popup_VR_CSS_selector

8. Finish creating the pop-up.

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.