Top
Window Variables as Visibility Rules
  • 21 Dec 2023
  • 1 Minute To Read
  • Dark
    Light
  • PDF

Window Variables as Visibility Rules

  • Dark
    Light
  • PDF

Article summary

​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

Display a widget only to your internal employees

Use the following steps to configure the Visibility rules in a widget:

  1. Under the Visibility Rules condition, select Window Variable.
    2022-06-24_13-41-03

  2. Enter the variable name.
    Dashboard_setvisibility_windowvariable_equals(1)

  3. Select the operator and enter the value.
    Dashboard_setvisibility_windowvariable_equals_whatfixuser(1)

  4. Click Save.

your title goes here

To find a window variable that uniquely identifies users in your application, contact support@whatfix.com.

Display a widget to specific user roles

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:

  1. Under the Visibility Rules condition, select Window Variable.
    2022-06-24_13-41-03

  2. Enter the variable name you created in Advanced Customization.
    2023-05-02_17-49-44.png

  3. Select the operator and enter the value.
    2023-05-02_17-50-32.png

  4. Click Save.


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.