---
title: "Window Variable Condition"
slug: "window-variable-condition-rule"
updated: 2025-03-07T07:26:58Z
published: 2025-03-07T07:26:58Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.whatfix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Window Variables as Visibility Rules

Note:

If you see the following UI, you have the New Visibility Rules enabled for the account. For more information, see [Understand New Visibility Rules](https://support.whatfix.com/docs/understand-visibility-rules-20). ![Visibility Rules 2.0 screenshot](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/vr2_main%20page.png)

  

​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](/studio/docs/supported-operators)

## 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](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/2022-06-24_13-41-03.png)
2. Enter the variable name. ![Dashboard_setvisibility_windowvariable_equals(1)](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/Dashboard_setvisibility_windowvariable_equals(1).png)
3. Select the operator and enter the value. ![Dashboard_setvisibility_windowvariable_equals_whatfixuser(1)](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/Dashboard_setvisibility_windowvariable_equals_whatfixuser(1).png)
4. Click **Save**.

          your title goes here

          

To find a window variable that uniquely identifies users in your application, contact [support@whatfix.com](mailto:support@whatfix.com?Subject=Display%20a%20widget%20to%20internal%20employees&amp;Body=Hello%20Team%2C%0A%0APlease%20provide%20assistance%20with%20finding%20a%20window%20variable%20that%20uniquely%20identifies%20users%20in%20our%20application.%20We%20intend%20to%20display%20a%20widget%20to%20internal%20employees.%20%0A%0A%0AThanks%20and%20regards.%22translate=%22no%22).

  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](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/2022-06-24_13-41-03.png)
2. Enter the variable name you created in Advanced Customization. ![Window_variable_.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/Window_variable_.png)
3. Select the operator and enter the value. ![Window_variable_equals.png](https://cdn.document360.io/a268766e-d74d-4619-9613-e2472f809ffb/Images/Documentation/Window_variable_equals.png)
4. Click **Save**.

## Related

- [Whatfix User Roles](/whatfix-user-roles.md)
- [Display Content based on User Roles](/display-content-based-on-user-roles.md)
