- 02 Aug 2023
- 1 Minute To Read
- Print
- DarkLight
- PDF
How to display pop-ups based on user roles?
- Updated On 02 Aug 2023
- 1 Minute To Read
- Print
- DarkLight
- PDF
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,
On the Whatfix dashboard, click Widgets.
Click Create widget.
Click Popup.
Enter a name and content for the Pop-up, and then click the Set Visibility Rules → button.
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 Variable to identify user roles. You can use different methods that fits with your app 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.