- 24 Jun 2024
- 2 Minutes To Read
-
Print
-
DarkLight
-
PDF
Action Element conditions as Display Rules
- Updated On 24 Jun 2024
- 2 Minutes To Read
-
Print
-
DarkLight
-
PDF
Introduction
To ensure that performing an action on a particular element triggers the branched Flow, use the Action Element Is or Action Element Text as a Display Rule. This enables you to add identifiers or properties to ensure that the branched Flow starts on the correct element.
The following are the Action Element rules:
Action Element Is (Select Element/CSS Selector/jQuery Selector)
Action Element Text (Select Element/Is, Is One Of)
The Action Element rules are available only under Display Rules for Branching in a Flow.
For more information, see Branching in Flows.
Types of Action Element condition rules
Action Element Is (Select Element/CSS Selector/jQuery Selector)
-
Whatfix enables you to select an element as a Display Rule by using the Select Element option from the dropdown. Clicking this element triggers the branched Flow.
-
Web applications use unique IDs for some elements on the page. Add the unique ID as a CSS Selector/jQuery Selector for the element. This is used when your element needs to be selected from a list of options. For example, a dropdown menu.
The following are examples of jQuery selectors:
- $("#firstname"): Selects the element with id="firstname"
- $(".primary"): Selects the element with class="primary"
The following are examples of CSS selectors:
- input[title="Search"]: Selects the input element with the title "Search"
- [id="#analytics-left-pane"]: Selects the element with the id="analytics-left-pane"
Action Element Text (Is/Is One Of)
This is the text that is displayed on the Action Element that is selected. If your application supports multiple languages, choose the Is One Of option and add the name with a comma(,) as a delimiter.
The value is case-sensitive.
Use Cases
Consider that you want to trigger a branched Flow on one of the options inside a dropdown. These options have unique identifiers (IDs) as CSS Selectors.
-
On the Whatfix Studio, select the rule as Action Element Is and CSS Selector.
-
Enter the selector.
-
Finish creating the Whatfix content.
Consider that you want to trigger a branched Flow on buttons, that don't have unique identifiers other than button names. In such a scenario use the Action Element Text to ensure that the branched Flow triggers correctly.
-
On the Whatfix Studio, select the rule as Action Element Text and Is.
-
Enter the button name.
-
Finish creating the Whatfix content.