Top
How to display pop-ups based on user roles?
  • 14 Jun 2024
  • 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 their role or segment, using the window variable option. The value for the window variable needs to be configured and 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 Pop-ups.
    ia_widget_popups

  3. Hover your cursor over the Pop-up segment you want to configure, and then click the Edit icon.
    CLM_DB_Click_edit_icon.png

  1. Click Set Visibility Rules →.
    Set_visibility_rules

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

  3. 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.

The following example uses window variables to identify user roles. Use different methods that fit with your application's 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

  1. 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.