When working with Power Automate, there will be situations where we need to check if an array contains a specific value or a partial text.
For this, Power Automate has a function named contains() function to check whether an array or a string contains a specific value.
In this tutorial, I will explain how to check if an array contains a specific value using the Power Automate contains() function and show how to check if an array contains a certain string with the filter array action in Power Automate.
Power Automate Array Contains() Function
Power Automate contains() function will check if an array or string contains a partial text or a specific element.
The output returned will be ‘true‘ if the array or string contains a specific element; else, it will return as ‘false.’
Power Automate contains() function is case-sensitive; it only checks for the exact match of an element.
| Input | Function | Output |
| ‘Lidia’, ‘Henrietta’ | contains(“Lidia”,”Henrietta”),’Lidia’ | true |
| ‘Lidia’, ‘Henrietta’ | contains(“Lidia”,”Henrietta”),’Lidia Holloway’ | false |
Power Automate Check if an Array Contains a Value using contains() function
Here, I will discuss how to check whether an array contains a specific element by using the Power Automate contains() function.
I have explained the Power Automate contains() function in the above section.
Example:
| Input | Expression | output |
| [“California”,”Florida”,”Texas”] | contains([“California”,”Floria”,”Texas”],’Florida’) | true |
Check the below-mentioned steps:
1. Navigate to the Power Automate home page and click “+Create” -> Select “Instant cloud flow. ” Then, set the flow name, choose “Manually trigger a flow,” and click on the Create button.
2. Take a new step as the Initialize variable flow action to initialize the values of an array.
Configure the below parameters:
- Name: Set a name for an initialized variable.
- Type: Select datatype as ‘Array’.
- Value: Here, I have taken the below-shown values.

3. Add a Compose flow action to include the contains() expression to check whether the array has a specific element or not.
Inputs: Provide the below-given expression in it.
contains(variables('United States'),'Florida')
4. Once the flow is ready. Save it and Test it Manually. Click on Runflow.
5. If the array contains a given element, the output will be returned as ‘true‘ as shown below:

This is how to use the Power Automate contains() function to check whether the array contains a specific value.
Check if an array contains a specific value in Power Automate using Filter Array
Let’s see how to check if the array contains a specific value from the Power Automate filter array action.
Scenario:
The image below shows a SharePoint list with a Country column [Single line of text].
I wanted to check whether the Country column contains a specific country [Egypt] or not.

Go through the below steps:
- Take Manually trigger a flow trigger.
- Next, add the ‘Get items‘ flow action to retrieve all the items from a SharePoint list. Select the Site Address and List Name.

3. Take an ‘Initialize Variable‘ flow action. Set a Name for a variable and datatype as ‘Array.’

4. After that, add Append to array variable flow action. Set the below details:
- Name: Choose a name from the drop-down.
- Value: Select the ‘Country‘ column from dynamic content.
Then, For each loop will be added automatically.

5. Take a ‘Filter array‘ flow action. Provide the below details:
- From: Take the value of a variable[Countries]
- Filter query: Give the below expression
@contains(@{item()},'Egypt') 
6. Now save and test the flow. Test it manually.
7. When the flow runs successfully, open the filter array and check whether the array contains a specific element or not.
Refer to the image below:

This is how to check if an array contains a specific value in the Power Automate filter array action.
Conclusion
I hope this tutorial helped you to check if an array contains a specific value or not using Power Automate.
Here, I have described two methods to check if the array contains a value in Power Automate.
- By using Power Automate contains() function
- Through Power Automate Filter array action
You may also like the following tutorials:
- Power Automate Array Variable
- How to use append to string variable action in Power Automate?
- Power Automate Set Variable
- How to Use Power Automate dayOfWeek Function?
- Power Automate String Functions

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.