Logic/Conditions

COMPARESTR – Compare field contents with value

36 views June 1, 2018 admin 0

Overview

This Custom Field compares the contents of a field with a value and returns a match result.

Syntax

COMPARESTR(Availability,‘Now’,‘Now Available’,‘Out Of Stock’)

 

Element Description
FieldName The content to decode.
Value Value.
IfTrue (Optional) result if TRUE.
IfFalse (Optional) result if FALSE.

Example

Fields with a fixed value:

COMPARESTR(Availability,‘Now’,‘Now Available’,’Out Of Stock’)

If the ‘Availability’ field contains ‘Now’ then ‘Now Available’ will be
output; if the field does not contain ‘Now’ then ‘Out Of Stock’ will
be output.

Comparing a field with another field:

The FIELDSTR command can be used to compare the contents of one field to another.

COMPARESTR(‘PyjamaTopColour’, FIELDSTR(‘PyjamaBottomColour’), ‘Match’, ‘No Match’)

In example above, the contents of the ‘PyjamaTopColour field are compared with the contents of the ‘PyjamaBottomColour’ field. returning ‘Match’ if identical. If they are not they will return a value of ‘No Match’.

See also

IF

AND

OR

Was this helpful?