contains function. Collection.(Power Automate Cloud flows)
This function checks whether an array contains a specified item.
There is also a function of the same name that checks whether a given text is contained.
Spec
contains(<collection>,<value>)
Argument | Default | Description |
---|---|---|
collection | Required field | Target array. |
value | Required field | The item to search. |
How to use
Often used in "Condition".
It is also frequently used to initialize or set variables of type "Boolean" in order to use the result in subsequent actions.
Clicking on contains in the "Expression" tab sets the function name and () in the formula field.
If you see something like the following, your settings are complete.
You can change the contents of the function by clicking on the purple icon.
In this case, array variables [1,2,3] are provided as an example.
If we set the expression as contains(variables('array1'),2) , The result is True because [1,2,3] contains "2".
When dynamic content or variables are used in expressions, special specifications are required.
(How to get dynamic content with expressions.)
Elements may be non-numeric.
For strings, the search is case-insensitive and exact match is performed.
To incorporate the result of this function into a "Condition" action, set the following.
Left | The result of the contains function. |
Center | is equal to |
Right | true |
"If yes" is the action when the specified item exists, and "If no" is the action when the specified item does not exist.
For those who want to learn Power Automate Cloud flow effectively
The information on this site is now available in an easy-to-read e-book format.
Or Kindle Unlimited (unlimited reading).
You willl discover how to about basic operations.
By the end of this book, you will be equipped with the knowledge you need to use Power Automate Cloud flow to streamline your workflow.
Discussion
New Comments
No comments yet. Be the first one!