Skip to content
Last updated

If/else

Node type browser_ifElse

What it does

Select one branch based on conditions and use a default branch when configured.

Desktop client configuration

If/else configuration in the desktop client

Captured in the English interface of MoreLogin Desktop V2.73.101.

Inputs

These fields belong in data.browserUi.inputs.

This node has no dedicated input fields.

Mode requirements and limits

  • Inputs: There are no action fields. You can omit inputs or pass {}. inputs has no fields. blocks must be case/caseDefault, with at most one default branch. The first branch whose conditions are met, in branch order, is taken. Each branch has only one condition group (AND within the group). To express OR, add branches.
  • Validation code RPA_NODE_INPUT_INVALID

Outputs

Output fieldType or values
matchedboolean
branchstring / null
branchIdstring / null

Reference published fields as ${nodeId.data.field}.

JSON example

A complete node object for a workflow's nodes array or another node's blocks. It reads read_title.data.text, the output of an earlier Read element data node.

{
  "id": "check_heading",
  "type": "browser_ifElse",
  "data": {
    "title": "Check whether the page is the sign-in page",
    "browserAction": "ifElse",
    "browserUi": {
      "inputs": {}
    }
  },
  "blocks": [
    {
      "id": "is_sign_in",
      "type": "case",
      "data": {
        "title": "Sign-in page",
        "conditionGroups": [
          {
            "content": [
              {
                "left": {
                  "type": "ref",
                  "content": [
                    "read_title",
                    "data",
                    "text"
                  ]
                },
                "operator": "contains",
                "right": {
                  "type": "constant",
                  "content": "Sign in"
                }
              }
            ]
          }
        ]
      },
      "blocks": [
        {
          "id": "click_sign_in",
          "type": "browser_click",
          "data": {
            "title": "Click the sign-in button",
            "browserAction": "click",
            "browserUi": {
              "inputs": {
                "selectorType": "selector",
                "selectorRadio": "CSS",
                "selector": "#sign-in",
                "postWaitMs": 300
              },
              "exception": {
                "timeout": 30000,
                "policy": "interrupt"
              }
            }
          }
        }
      ]
    },
    {
      "id": "other_page",
      "type": "caseDefault",
      "data": {
        "title": "Any other page"
      },
      "blocks": [
        {
          "id": "reload_other",
          "type": "browser_refreshPage",
          "data": {
            "title": "Reload the page",
            "browserAction": "refreshPage",
            "browserUi": {
              "inputs": {
                "postWaitMs": 1000
              },
              "exception": {
                "timeout": 30000,
                "policy": "interrupt"
              }
            }
          }
        }
      ]
    }
  ]
}

Back to the node catalog