contains function. String.(Power Automate Cloud flows)
This function checks whether the specified text is included.
It has a similar role to indexOf, with the following differences.
Function | Result | Case-sensitive. |
---|---|---|
contains | Boolean. Exists (true). Does not exist (false). | Case-sensitive. |
indexOf | Start position of the found text. | Not Case-sensitive. |
Spec
contains('<text>', '<value>')
Argument | Default | Description |
---|---|---|
text | Required field | Target text. |
value | Required field | Text to be searched. |
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.

For example, if contains('abcdef','cd') is specified, the result is true because "cd" is contained in "abcdef".


When dynamic content or variables are used in expressions, special specifications are required.
(How to get dynamic content with expressions.)
contains is case-sensitive, so contains('abcDef','Cd') will result in false.


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 text exists, and "If no" is the action when the specified text 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!