Top
Adding a branch to a walkthrough
  • 6 minutes to read
  • Print
  • Dark
    Light

Adding a branch to a walkthrough

  • Print
  • Dark
    Light

Branching can be added while creating a new walkthrough or when editing an existing walkthrough.

  1. Click the Whatfix Editor plugin to launch the editor.
    editorplugin

  2. Click Flow.
    editor_flow.png

  3. Enter the name of the walkthrough as you want it displayed to a user.
    name_your_flow_field1.png

  4. Click +Step.
    %2Bstep1.png

  5. Click the desired element on the page that the user needs to select.
    select%20element.png

  6. In the editor, scroll down to the Advanced Options.

Note
If the Advanced Options is not displayed, click the checkbox to enable it.
check_advanced_option.png
  1. Under the Branching Rules, configure the branching conditions for the step.

  2. Use the If condition to define the conditions for branching. The table at the end of this document explains each condition in detail.
    branching_if_condition.png

  3. Use the Then condition to select and attach the flow you want to branch to. 
    branching_then_condition.png

  4. Next, select the step number you want the flow to jump to.

  5. Use Add Another button to add multiple branching conditions, if needed.
    add_another_button.png

  6. Finish creating the walkthrough.

    Commonly used conditions when configuring branching rules are explained below.
    Condition Description
    Other Element

    If you want to identify a page based on the presence of a particular element (other than the one you have selected) on your web page, you can use this condition.The values passed to this condition are CSS selectors like #ID, .class or Jquery.

    Window Variable
    For advanced customization, you can choose to identify a page 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 as below:
    • Greater than

    • Less than

    • Date Greater than

    • Date Less than

    Note: You don't need to add a window at the start for window variables.

    Action Element

    This is the element that the user clicks to decide which branch to take. These are typically buttons or tabs that do not have any options to choose from.

    Action Element Text This is the text that is displayed on the Action Element that is selected above.

    Selected Element 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. This lets you provide your own CSS selector identifier for the element.Sample values
    #ID_ELEMENT.CLASSNAMEinput[title="Search"]
    $("#ID")

    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: The value is case sensitive.

    For a better understanding of CSS selectors, see CSS Selectors .

    Supported Operators

    Operator Description
    Equals For exact match
    Not Equals Doesn't equal the value
    Contains Setvalue is present anywhere in the value of the condition. (Check for strings)
    Not Contains Setvalue is not present anywhere in the value of the condition
    Starts With Setvalue is at the beginning of the value of the condition
    Ends With Setvalue is at the end of the value of the condition
    Exists Setvalue is available (or true)
    Not Exists Setvalue is not available (or false)
Note
  • Incomplete branches are not evaluated.
  • If you don't have the walkthrough that you want to skip to, you can add the conditions while creating the walkthrough and add the walkthrough later.
  • A step can have multiple branches. The first branch whose conditions are evaluated as true is selected.
  • If you have created walkthroughs 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 will show up only if all the conditions are true. (Similar to Boolean AND) 
  • jQuery CSS selector options will always show in the UI, however, it is supported ONLY for applications that have jQuery in the underlying platform
For window variables:
  • Greater and less than only accept 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. Contact your CSM for the same.

Branching in an iframe and ShadowDOM application

When trying to select an element Whatfix automatically detects the best element from your application pages. However, there may be instances where certain elements cannot be detected. This could be because the selected element is located inside multiple layers of code iframe, ShadowDOM, or both.
The table below explains how branching can be done when you use iframe or shadowDOM applications. Note that the way you define element selection is different when you are dealing with an action element (when there is an action on the element) or if it is an other element (when there is no action on the element and you use the element to distinguish the page from other pages). An example for a selected element is a drop-down menu that could have several possible values. A selected element works just like an action element.

  • In an iframe application, if you are selecting an action element, then only the element and the immediate iframe that contains the element needs to be identified.
  • In an iframe application, if you are using the other element, the entire path is to be defined starting from the element back to the outermost iframe
  • In a ShadowDOM application, if you are selecting an action element or an 'other' element, the entire path is to be defined starting from the element back to the outermost ShadowDOM

See the example below for a clearer understanding of how to select an action element or an other element in each scenario.

When the element is in Action Element/ Selected Element Other Element

iframe

#element #element<<iframe2<<iframe1

ShadowDOM

#element<=shadowroot2<=shadowroot1

#element<=shadowroot2<=

shadowroot1

ShadowDOM which is inside an iframe

#element<=shadowroot3<=

shadowroot2

#element<=shadowroot3<=

shadowroot2<<iframe2<=

shadowroot1<<iframe1

Was this article helpful?