- 16 Nov 2022
- 7 Minutes To Read
- Print
- DarkLight
- PDF
Visibility and Display Rule Conditions
- Updated On 16 Nov 2022
- 7 Minutes To Read
- Print
- DarkLight
- PDF
- Overview
- List of available Visibility and Display Rule conditions
- Supported Operators
- Example use cases
Overview
Visibility Rules: Used to define where and to whom you want to display the widgets (Self Help, Task List, Pop-ups, Beacons and Smart Tips). Visibility Rules can only be configured while creating segments on the Whatfix Dashboard.
Display Rules: Used to define when to show the tooltips based on the conditions met. Also, some conditions let you define where you want to show the tooltips. Display Rules can be configured while creating Whatfix Content (Flows, Smart Tips, Beacons, User Actions) on the Editor or after creating on the Whatfix Dashboard.
List of available Visibility and Display Rule conditions
The following table lists all the conditions that can be used when configuring Visibility Rules to segment widgets or Display Rules to show the Tooltips. These rules determine where and when Whatfix content is displayed on your application.
Condition | Description | |
URL | You can use the URL criteria to specify the entire URL that you want to use as a visibility rule. You can specify the URL hostname, path, parameter, etc using this criterion. | ![]() |
URL Hostname | When you want to uniquely identify a page using the domain name, you can use this condition. The URL Hostname is the first part of any URL. ![]() | ![]() |
URL Path | The website pathname is the part that you see after your domain name but before the parameters or hashes. For example, if the website URL is https://ap17.lightning.force.com/lightning/#lead/ list?filterName=Recent, then the pathname is /lightning. Your condition looks something like the image on the right. | ![]() |
URL Parameter | If you want to identify your web page using the parameters on the URL, you can use this condition. For example, if you want to show a tip to a user only when the search phrase has leads in Salesforce, you can add a condition as shown in the screenshot on the right. ![]() As you can see in the snapshot on the right, we have added three conditions. 1. The page must be salesforce.com (URL Hostname) 2. The pathname is /login (URL Path) 3. The query parameter is ?q=leads | ![]() |
URL Hash | If you want to identify a page using the hash value of your URL, you can use this condition. Hashes are usually present in Single page applications made using AngularJS or ReactJS. There are no page refreshes but only Hash changes.![]() | ![]() |
Other Elements on Page | If you want to identify a page based on the presence of a particular element (other than the one selected by you) on your web page, you can use this condition. The values passed to this condition are CSS selectors like #ID, class, or Jquery. Note: Use the other element option only if it doesn't slow your application. | ![]() |
If you find using CSS Selectors difficult when configuring Display Rules, you can now use the Select Element option. It is as simple as selecting an element on your app. In the Display Rules section, choose the Select Element option from the dropdown, click the element in your app, and then finish configuring the rule as usual. | ![]() | |
Window Variable | For Advanced Customization, you can choose to identify using the value of a particular Javascript global variable. Example: If you want to check user.role='admin', you can set the condition. You can also use this option to perform comparison options using the following criteria:
Note: You don't need to add a window at the start for window variables. | ![]() |
User Attribute | User Attributes enable you to fetch end-users information from your app for content segmentation. These attributes are either created manually or automatically depending on the out-of-the-box Integrations done. | ![]() |
Enterprise Attribute | Enterprise Attributes enable you to fetch your application information for content segmentation. These attributes are either created manually or automatically depending on the out-of-the-box Integrations done. | ![]() |
Selected Element Is- CSS Selector/ JQuery | Your application uses unique IDs for some elements on the page. This is used when your element is selected from a list of options. For example, a drop-down menu. Use this option to provide your own CSS selector/identifier for the element. Sample values, #ID_ELEMENT .CLASSNAME input[title="Search"] ("#ID") Note: This condition is onlyavailable under Display Rules for tooltips. | ![]() |
Selected Element Text | This is the text that is displayed on the Element selector that is selected above. If your application supports multiple languages, you can choose Is One Of option and add the name with a comma(,) as a delimiter. Note:
| ![]() |
User Action | The User Action created on an element acts as a trigger to display content based on the action your end-users perform. See, Using User Actions as Visibility Rules. Note: This condition is only available under Visibility Rules for widgets. | ![]() |
Watch the following video for a better understanding of CSS selectors.
Supported Operators
Operator | Description |
---|---|
Equals | For exact match |
Not Equals | Doesn't equal the value |
Contains | Set value is present anywhere in the value of the condition. (Check for strings) |
Not Contains | Set value is not present anywhere in the value of the condition |
Starts With | Set value is at the beginning of the value of the condition |
Ends With | Set value is at the end of the value of the condition |
Exists | Set value is available (or true) |
Not Exists | Set value is not available (or false) |
While setting up display rules for your widgets, you can use the AND/OR settings for conditions. You can use these conditions as a combination as well.
- If you create a Smart Tip inside iFrames, then the window variable must be pointed to the respective frame. You may use window.frames
- If you are adding multiple conditions, then the tip is displayed only if all the conditions are true. (Similar to the Boolean AND)
- jQuery CSS selector options always show in the UI, however, it is supported ONLY for applications that have jQuery in the underlying platform.
- Greater and less than accept only numerical values
- For date greater than/less than the default format is “MM/DD/YYYY”. The format can be changed to match your system date format.To change the format, contact support@whatfix.com.
Use Cases
Display a widget on a specific page
When configuring the Visibility rules in a widget,
- Under the Set Visibility Rules section, select URL.
- Under the Operators section, select Equals.
- Copy the Browser URL, where you want to display the widget, and then paste it under the URL section.
- Click Save.
Display a widget on selected pages in an application
When configuring the Visibility rules in a widget,
- Under the Visibility Rules condition, select URL.
- Under the Operator section, select Not Equals.
- Copy the Browser URL of the page you don't want the widget to appear, and then paste it under the URL section.
- ClickSave.
Display a widget on all pages across the application
When configuring the Visibility rules in a widget,
- Under the Visibility Rules condition, select URL.
- Under the Operator section, select Contains.
- Copy the URL value that is common across all the pages of your application, and then paste it under the URL section.
- ClickSave.
Display a widget on all pages across the application except one
While configuring the Visibility rules in a widget,
- Under the Visibility Rules condition, select URL.
- Under the Operator section, select Contains.
- Copy the URL value that is common acrossall the pages of your application, and then paste it under the URL section.
- Click the Plus icon.
- Select URL as the display rule condition.
- Under the Operator section, select Not Contains.
- Copy the URL value specific to the page you don't want the widget to appear on, and then paste it under the URL section.
- ClickSave.
Display a widget on an application in case you have dynamic URLs
A dynamic URL has a URL path that is divided into two parts. One part of the URL path is dependent on user-defined variables, that keep changing to display specific information depending on user inputs. The other part of the URL path is independent of user inputs and remains common throughout the application.
If the URL path ends with a dynamic value, then while configuring the Visibility rules in a widget,
- Under the Visibility Rules condition, select URL.
- Under the Operator section, select Starts with.
- Copy the independent URL path value, and then paste it under the URL section.
- Click Save.
If the URL path begins with a dynamic value, then while configuring the Visibility rules in a widget,
- Under the Visibility Rules condition, select URL.
- Under the Operator section, select Ends with.
- Copy the independent URL path value, and then paste it under the URL section.
- ClickSave.
Display a widget only on the login page of an application
While configuring the Visibility rules in a widget,
- Under the Visibility Rules condition, select Other Element on Page.
- Under the Operator section, choose Exist CSS Element.
- Enter the CSS Selector of the element.
- Click Save.
Display a widget only to your internal employees
While configuring the Visibility rules in a widget,
- Under the Visibility Rules condition, select Window variable.
- Enter the variable name.
- Under the Operator section, select Equals.
- Enter the variable value.
- Click Save.