While working on Power Automate flows, you can use the If() expression to validate the condition in a single line instead of taking multiple conditional branches.
In this tutorial, I will describe how to use the Power Automate If contains expressions with a few examples.
- Power Automate If Contains Text
- Power Automate If Contains Null
- Power Automate If String Contains Value
- Power Automate If Array Contains
Power Automate If Contains Text
I will show you how to use the If contains expression in a Power Automate cloud flow with a scenario.
Scenario: Suppose I have a SharePoint list named ‘Customer Contacts List‘ with a few columns.
I require that if the Mobile Number column contains a default value [NA], it should be updated to “Update Mobile Number.”

Steps:
1. Go to Power Automate and create an Instant Cloud flow by manually triggering a flow from the SharePoint connector.
2. Add the Get Items action to fetch items from a SharePoint list. Provide the required parameters, such as the Site Address and List Name.

3. Now, take Compose action to take the column value [Mobile Number ]from the dynamic content.
Each loop will be automatically added by taking the body/values from the Get items action.

4. After this, add another Compose action to check if the column [Mobile Number ] contains any default text value.
Add the expression below to the Inputs section.
if(contains(outputs('Compose_-_Mobile_Number'),'NA'),'Update Mobile Number',outputs('Compose_-_Mobile_Number'))
5. Add the Update item action to update all the text values in the SharePoint list column [Mobile Number].
- Site Address: Choose the Site Address where your SharePoint list is present.
- List Name: Select the desired SharePoint list.
- Id: Take ID from the dynamic content of the get items action.
Click on Show all to display the Advanced parameters.
- Mobile Number: Choose and add outputs of the compose action.

Now click on Save and run the flow manually.
6. Once the flow runs successfully, all blank values in the SharePoint list column[Mobile Number] have been updated with the text[Update Mobile Number].

This is one of the examples of how to use an if condition that contains text in PowerAutomate.
Power Automate If Contains Null
Power Automate If contains null expression generates an error, as it should not be able to accept a null value.
This is because the contains() functions expect parameters of matching types: a dictionary and a key (string), an array and a value (object), or a string and a substring. If the null values are present, an error will be generated.
Error: Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'contains' expects parameters of matching types: a dictionary and a key (string), an array and a value (object), or a string and a substring. The provided types 'String' and 'Null' are incompatible. Please see https://aka.ms/logicexpressions#contains for usage details.'.
Power Automate If String Contains Value
To explain if the string contains a value in Power Automate, follow the below steps:
Scenario: Sending a canceled notification to the employees for a Flight ticket type as Business class.
I have a SharePoint list [Travel authorization] with a few columns. The Flight Details column contains a specific value [FlightTicketType].
If the Flight Details column contains [FlightTicketType: Business] -> Send an email to employee.
| Column Name | DataType |
| Employee Name | Single line of text |
| Flight Details | Multiple lines of text |
| Department | Choice |
| Start Date | Date and Time |
| End Date | Date and Time |

Check Out the Steps:
1. Create a Power Automate Automated Cloud flow -> Select When an item is created trigger -> Choose Site Address and List Name.

2. Next, take a Compose action to check whether the string contains a specific value.
Add the code below to the Inputs parameter.
if(contains(triggerBody()?['FlightDetails'],'FlighTicketType: Business'),'Yes','No')
4. After that, add a Condition control to check if the output returned from the compose action is true.
Outputs('Compose') is equal to Yes
5. Under True branch, add a Send an email(V2)action, to notify an employee that the Travel request has been cancelled.
Configure the parameters like To, Subject, and Body.

6. Once the flow is completed, Save and Test the flow. Go back to the SharePoint list and add an item as shown in the image below:

7. If the condition satisfies, it will send an email to the employee, as represented in the screenshot below:

Power Automate If Array Contains
There is a complete tutorial on Power Automate If Array, which contains a value with different examples.
You can click the link below to learn if an array contains examples in Power Automate.
Check If an array Contains a Value using Power Automate
Conclusion:
I hope this Power Automate tutorial has taught you how the If contains() function works in Power Automate with all the related examples like:
- Power Automate If Contains Text
- Power Automate If Contains Null
- Power Automate If String Contains Value
- Power Automate If Array Contains
- Check if a String Contains Numbers in Power Automate
- Check if an Item Exists in a SharePoint list Using Power Automate
- Check If a String is Empty in Power Automate
- Check the Condition If Blank in Power Automate
- Power Automate Contains() Function
- Delete SharePoint Folders Using Power Automate

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.