Compare Values

This is a pre-built Action located under the @Generic Element. The functionality of this Action in Avo Assure is to compare two strings without considering their case sensitivity, treating both strings as the same case. The comparison result is then stored in a dynamic variable.

Syntax

Input Value: <value1>;<value2>;<lowercase(True/true)>(Optional)

Argument
Description

<value1> (Required)

Provide the first value that needs to be compared.

The input value can accept special characters, numbers, and string.

<value2> (Required)

Provide the second value that needs to be compared with the first value.

<lowercase(True/true)> (Optional)

Provide this (True/true) argument to convert both values to lowercase before comparison. This helps ensure the comparison is case-insensitive.

Note: Use this only if you want to ignore case differences between uppercase and lowercase letters.

Output Value: <Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

Argument
Description

<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

Both dynamic variable stores the status as True or False.

Example 1: Comparing Two Values

In this example, we explain how to compare two values.

  • Action: Compare Values

  • Input Value: 123SAP23;123SAP23

    • The first argument (123SAP23) specifies the first value.

    • The second argument (123SAP23) specifies the second value to compare.

  • Output Value: {Status}

    • The result of the comparison is stored in this {Status} dynamic variable with the following possible values:

      • True: If both values are identical.

      • False: If both values are different.

Note: If the output variable is not defined, the comparison result will be displayed only in the execution logs and not stored in any variable.

  • Logical Explanation: The Compare Value action fetches two values from the Input Value column (123SAP23;123SAP23) and compares them. Since both values are identical, the result of the comparison is True, which is stored in the {Status} variable.

Example 2: Comparing Two Values with Case-Insensitivity

In this example, we explain how to compare two values.

  • Action: Compare Values

  • Input Value: Apple;apple;True

    • The first argument (Apple) specifies the first value.

    • The second argument (apple) specifies the second value to compare.

    • The third argument (True) is an optional flag that makes the comparison case-insensitive.

  • Output Value: {Status}

    • The result of the comparison is stored in this {Status} dynamic variable with the following possible values:

      • True: If both values are identical, or match after ignoring case when the case-insensitive flag (True/true) is used.

      • False: If both values are different even after applying the case-insensitive comparison.

Note: If the output variable is not defined, the comparison result will be displayed only in the execution logs and not stored in any variable.

  • Logical Explanation: The Compare Value action takes two values from the Input Value column (Apple;apple;True) and compares them. Since the optional flag (true/True) enables case-insensitive comparison, the result of the comparison is True, which is stored in the {Status} variable.

knowledge Bites: Below are some examples of different string scenarios

String
Input Value
Result

Numeric Strings

123;153

False

Alphanumeric strings

ID8765;ID8565

False

Last updated

Was this helpful?