Skip to content

CONTAINS

Usage

Use this function to check if a given value is contained in list or not

Category Function Type Where to use Argument statement
FUNCTION SERVER ROW COMPARISON .VALUE

Syntax

1
=CONTAINS(Values_List; Value)

Arguments

Values_List
Values list where checking if Value argument is contained: any list (you have to use LIST function) composed by constant values, System Variables, column field value (#Storage_Name.Field_Name.VALUE or .OLDVALUE) or a function-returned list of values (LOOKUPLIST function)

Value
Value to check in the Values_List argument: any column field value (#Storage_Name.Field_Name.VALUE or .OLDVALUE), constant, System Variables or function-returned value

Note

The CONTAINS function can be used as a conditional argument in Client Function if Values_List and Value are not depending on record's fields value

Return Value

Boolean (true or false)

Examples

Example 1

Formula
=CONTAINS(
=LIST("Data 1"; "Data 2");
"Data 1"
)

Description
Check if the value Data 1 is contained in the list Data 1, Data 2

Result
true

Example 2

Formula
=CONTAINS(
=LIST($CURRENTUSER.GROUPNAMES;
"Group 1"
)

Description
Check if the Group 1 is contained in the Groups list of the current User (variable). So if the User is in the Group 1

Result
true or false

Example 3

Formula
=CONTAINS(
=LIST("Sales"; "Marketing");
=LOOKUP(#HR; #HR.Role; #HR.Name == $CURRENTUSER.NAME)
)

Description
Take from Storage HR the values of the column Role where the Name matches with current User name (LOOKUP function + variable) and check if the User's role is contained in the list Sales and Marketing

Result
true or false

Example 4

Formula
=CONTAINS(
=LOOKUPLIST(#HR; #HR.Team; #HR.Department == "Production");
"Quality Assurance")
)

Description
Check if the value Quality Assurance is contained in the list returned taking from Storage HR the Team where Department is equal to Production (LOOKUPLIST function)

Result
true or false