- 21 Dec 2023
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Window Variables as Visibility Rules
- Updated On 21 Dec 2023
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Window Variable rule can be used when you need to make some content or widget available based on a global Javascript variable that is present in the application or based on the one you created in Whatfix Advanced Customization.
You can also use this option to perform comparison options using the following operators:
- Greater than
- Less than
- Date Greater than
- Date Less than
For more information, see Supported Operators for Visibility and Display Rules
Use Cases
Use the following steps to configure the Visibility rules in a widget:
-
Under the Visibility Rules condition, select Window Variable.
-
Enter the variable name.
-
Select the operator and enter the value.
-
Click Save.
To find a window variable that uniquely identifies users in your application, contact support@whatfix.com.
For Advanced Customization, you can choose to identify the value of a particular Javascript global variable. For example, if you want to check the user role, you can set the condition user.role='admin'.
Use the following steps to set the Window Variable you created as Visibility Rules:
-
Under the Visibility Rules condition, select Window Variable.
-
Enter the variable name you created in Advanced Customization.
-
Select the operator and enter the value.
-
Click Save.