Skip to content

Startswith Operation: startswith

The startswith operation under the String Operations function is used to check if a given string begins with a specific substring or character. This operation returns true if the string starts with the provided argument and false otherwise.

Example: Suppose you have a string “Welcome to HuLoop” and want to verify if it starts with the word “Welcome“.

Steps to Configure:

  1. Add a new step.
  2. Select Set a Variable Value from the Action dropdown.
  3. Enter a variable name in the Element Key field (e.g., StartsWithResult). This variable will store the result of the operation (true or false).
  4. Click on Form, select Functions, and choose String Operations.
  5. Provide the following parameters:
    • Operation: Choose startswith.
    • Data: Enter the string to check (e.g., “Welcome to HuLoop“).
    • Argument: Enter the substring to check at the beginning of the string (e.g., “Welcome“).
  6. Click Save.
scrn-startswith-operation-tabular-view
Tabular View
scrn-startswith-operation-card-view
Card View

Outcome on Execution:

  • The operation checks if the string “Welcome to HuLoop” starts with the substring “Welcome“.
  • Since the condition is true, the result (true) is stored in the variable defined in the Element Key field (e.g., StartsWithResult).
  • This variable can be referenced in subsequent automation steps using the syntax ${VariableName} (e.g., ${StartsWithResult}).

Back To Top