A training coordinator I worked with wanted an email every time someone signed up for a Java course in their SharePoint enrollment list. Their flow used contains() to check the course name, and it worked in testing. Then real sign-ups started, and it missed half of them. People had typed “java” and “JAVA”, and contains() only matched “Java”.
That’s the one thing everyone should know about contains(): it’s case-sensitive. In this tutorial, I’ll show you how the function works with text, arrays and objects, how to make it ignore case, and how to use it in a Condition.
Quick answer: contains(collection, value) returns true if a string contains a piece of text, an array contains an item, or an object has a key. For example, contains('Power Automate for SharePoint', 'SharePoint') returns true. It’s case-sensitive, so for text, compare lowercase versions: contains(toLower(variables('Course')), 'java').
How the contains() function works
contains() takes two parameters: the collection to search, and the value to look for. It returns a Boolean, true or false:
contains('<collection>', '<value>')
Microsoft lists it with the collection functions, because the “collection” can be one of three things, and it behaves a little differently for each:
| Collection | What it checks | Example | Result |
|---|---|---|---|
| String | Whether the text appears anywhere in the string | contains('Power Automate for SharePoint', 'SharePoint') | true |
| Array | Whether one of the items matches exactly | contains(createArray('North','South','East','West'), 'East') | true |
| Object | Whether the object has a key with that name (not a value) | contains(json('{"state":"TX","zip":"75001"}'), 'state') | true |
For strings, partial matches count: contains('hello world', 'world') is true. For arrays, the whole item has to match: contains(createArray('North','South'), 'Nor') is false.
Example 1: Check whether text contains a word
Create an instant cloud flow with the Manually trigger a flow trigger. Add an Initialize variable action named Power Platform, of type String, with some text as the value:

Add a Compose action. In Inputs, open the expression editor (select the fx icon, or type / in the new designer) and enter:
contains(variables('Power Platform'), 'Power BI')

Here’s the finished flow. Select Save, then Test > Manually > Test:

Because the text includes “Power BI”, the Compose output is true:

Example 2: Check a SharePoint column
For the enrollment scenario, I used a SharePoint list called Course Enrollment Form with these columns:
| Column | Type |
|---|---|
| Course to Enroll | Single line of text (the renamed Title column) |
| Full Name | Single line of text |
| Date of Enrolling | Date and Time |
Create an automated cloud flow with the SharePoint trigger When an item is created or modified, and pick the site and the list. (This trigger works with custom lists and libraries; Microsoft doesn’t support it on the Announcements, Contacts, Events or Tasks list templates.)
Add an Initialize variable action named Course with the Title column as its value:

Then add a Compose action with this expression:
contains(variables('Course'), 'JAVA')


Save the flow, select Test > Manually, and add an item to the list. For a course that doesn’t contain “JAVA” in capital letters, the output is false:

You don’t need the variable, by the way. You can check the column directly: contains(triggerBody()?['Title'], 'Java').
Make contains() ignore case
As the coordinator found out, contains('Java Basics', 'java') returns false. To match any capitalization, convert both sides to lowercase:
contains(toLower(variables('Course')), 'java')
If the search text also comes from dynamic content, lowercase it too: contains(toLower(variables('Course')), toLower(variables('Keyword'))). Not every text function works the same way, which catches people out:
| Function | Case-sensitive? |
|---|---|
contains() | Yes |
replace() | Yes |
startsWith() | No |
endsWith() | No |
indexOf() | No |
Use contains() in a Condition
Usually you want the flow to do something based on the result. In a Condition action, you have two options:
- Use the built-in operator: choose the column on the left, the contains operator, and the text on the right. It’s easier to read, but it’s case-sensitive too.
- Use the expression: put
contains(toLower(triggerBody()?['Title']), 'java')on the left, is equal to as the operator, andtrueon the right. Entertrueas an expression, not as typed text, or you’ll be comparing against the word “true”.
For more examples, see Power Automate if contains and how to check a condition that contains a string.
Common problems
The flow fails when a column is blank
If the SharePoint column is empty, the value is null, and contains() fails with an error. Give it an empty string instead: contains(coalesce(triggerBody()?['Course'], ''), 'Java'). For more on blank values, see how to check if a string is empty.
It returns false for an array of objects
With an array of objects, such as the items from Get items, contains() compares whole objects, so it won’t find a single property. Use a Filter array action instead, with a condition on the property, and then check length(body('Filter_array')) is greater than 0. The check if an array contains a value tutorial walks through it.
You want to filter SharePoint items before they reach the flow
Use the Filter Query in Get items with SharePoint’s own function, for example substringof('Java', Title). It runs on the server, so the flow only gets matching items.
These Power Automate expression tutorials go well with contains():
- Power Automate String Functions + 10 Examples
- Power Automate startsWith() Function [With endsWith() Function]
- Power Automate endsWith() Function [How to Use]
- Power Automate indexOf() Function | Power Automate lastIndexOf()
- Power Automate toLower() Function [How to Use]
- How to Check If an array Contains a Value using Power Automate?
Frequently Asked Questions
Is the Power Automate contains() function case-sensitive?
Yes. Wrap both values in toLower() to ignore case. Microsoft documents the function in its expression functions reference.
Can contains() check for a value in an array?
Yes. contains(createArray(‘North’,’South’), ‘South’) returns true. The whole item must match, not part of it.
How do I use contains() with a SharePoint column?
Use the column in the expression, for example contains(toLower(triggerBody()?[‘Title’]), ‘java’), and compare the result to the expression true in a Condition.
Why does contains() fail when the column is empty?
A blank column is null. Use coalesce(triggerBody()?[‘Column’], ”) to replace it with an empty string first.

Preeti Sahu is a Microsoft MVP for Power Apps with over six years of experience working with SharePoint Online and the Power Platform. She is the co-author of the book Microsoft Power Platform: A Deep Dive. As a Power Platform developer, she has built various tools with Power Apps and Power Automate, and she makes Microsoft 365 videos for YouTube.