PowerApps in operator and exactin operator are used to check whether a collection contains an item or not. The expression evaluates to a boolean value (true or false).
Left to the operator is the searched item and right to the operator is the collection where the item is potentially contained.
The only difference between the in operator and the exactin operator is that exactin is case sensitive and in is not.
PowerApps In operator examples
Let’s see some examples.
In with numbers
The in operator is not limited to strings. You use it with numbers as well.
ClearCollect(numbers,[1,2,4]);
1 in numbers // returns true
3 in numbers // returns false
In with strings
Please note that joe is found in names also it is provided with a lowercase ‘j’. The in operator is not case-sensitive. If you need case sensitivity use the exactin operator.
ClearCollect(names,["Joe","Mike","Sally"]);
"joe" in names // returns true
"paul" in names // returns false
Exactin with strings
In the example below you can see how exactin is case-sensitive. Providing ‘joe’ with a lowercase ‘j’ does not evaluate to ‘true’ in contrast to the in operator.
ClearCollect(names,["Joe","Mike","Sally"]);
"joe" exactin names // returns false
"Joe" exactin names // returns true
Not in operator
To negate the result of in just use the Not function.
ClearCollect(names,["Joe","Mike","Sally"]);
Not("joe" in names) // returns false
Filter using in operator
ClearCollect(names,["Joe","Mike","Sally"]);
Filter(names,"joe" in Value); // Returns collection with one record 'Joe'
In operator delegation
In case you want to filter or lookup data from a SharePoint list using the in operator, you will get a delegation warning. Unfortunately the in operator can not be delegated for SharePoint Lists. For a SQL datasource it is.
Thank you for the very clear post
Hi Yannis, always nice to get some feedback :-). Thank you!