- 14 Jun 2024
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
How to display pop-ups based on user roles?
- Updated On 14 Jun 2024
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
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,
-
On the Whatfix Guidance dashboard, click Widgets.
-
Click Pop-ups.
-
Hover your cursor over the Pop-up segment you want to configure, and then click the Edit icon.
-
Click Set Visibility Rules →.
-
Under the Where tab, select Window Variable from the dropdown.
-
Enter the Variable name, select Equals operator, and then enter the Variable value.
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.
If you're passing role permission in the URL parameters, the following method can be used.
If you're passing role permission in the URL Hash, the following method can be used.
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.
- Finish creating the Pop-up.