#PowerPlatformTip 129: 'Case-sensitive SharePoint Filtering'
SharePoint OData filtering ignores upper/lowercase, so 'ABC' also matches 'abc'. Combine an OData pre-filter with a case-sensitive Filter array in Power Automate.
TL;DR: SharePoint OData filters ignore upper/lowercase. Pre-filter with OData, then use a ‘Filter array’ with
equals(item()?['Title'],'ABC')to keep only exact-case matches.
💡 Challenge
A SharePoint query such as Title eq 'ABC' also returns the items abc and Abc. If the exact casing matters (codes, IDs, SKUs), the OData filter alone gives you too many results.
✅ Solution
Use OData for a fast first selection, then refine the result with a “Filter array” action. The equals() and contains() expressions compare text case-sensitively, so only exact-case matches remain.
🔧 How It’s Done
1. Pre-filter with OData
🔸 In “Get items” (or “Send an HTTP request to SharePoint”) set the Filter Query, e.g. Title eq 'ABC'.
🔸 With the test items ABC, abc, Abc and ABCD, Title eq 'ABC' returns the first three. startswith(Title,'AB') and substringof('bc',Title) are case-insensitive as well and return all four.
2. Refine with “Filter array”
🔸 From: the value output of “Get items”.
🔸 Switch the Filter array to advanced mode (Edit in advanced mode) and enter:
1
@equals(item()?['Title'],'ABC')
‘Filter array’ in advanced mode: From is the array to refine, Filter Query holds @equals(item()?['Title'],'ABC'), the designer shows item()?['Title'] as a Title token. The “Edit in basic mode” link confirms that advanced mode is active.
🔸 For a case-sensitive “contains” use:
1
@contains(item()?['Title'],'abc')
3. Check the result
| Input | equals(item()?['Title'],'ABC') | contains(item()?['Title'],'abc') |
|---|---|---|
| ABC | match | no match |
| abc | no match | match |
| Abc | no match | no match |
| ABCD | no match | no match |
🔸 Prefer the basic editor? Choose the Title token, is equal to and ABC. It builds the same equals() expression, so it is case-sensitive as well.
🎉 Result
OData returns ABC, abc and Abc. After the Filter array only ABC is left.
🌟 Key Advantages
🔸 Fast queries with OData
🔸 Exact-case results with equals() and contains()
🔸 Only the small OData result set is processed in the flow
⚠️ Good to Know
🔸 Not every text function is case-sensitive. equals(), contains() and replace() are. startsWith(), endsWith(), indexOf() and lastIndexOf() are not.
🔸 Without pagination, “Get items” returns only the first page of results. If the OData pre-filter can match many items, turn on Pagination in the action settings and set a threshold, otherwise the Filter array never sees the rest.
🎥 Video Tutorial
🛠️ FAQ
1. Why does the OData filter return abc for ABC?
SharePoint compares text in OData filters without distinguishing letter casing. eq, startswith and substringof all behave this way.
2. Which expressions are case-sensitive?
equals() and contains() on text are case-sensitive: equals('ABC','abc') returns false. startsWith() and endsWith() are not: startsWith('ABC','ab') returns true, so don’t use them for exact-case checks.
3. How do I compare case-insensitively on purpose?
Convert the value first: equals(toLower(item()?['Title']),'abc') matches ABC, abc and Abc.
4. Does Filter array impact performance?
It runs in the flow on the items it receives. With an OData pre-filter that set is small.
🔗 Related Tips
- #PowerPlatformTip 95: Optimized SharePoint Queries, design fast OData queries before refining.
- #PowerPlatformTip 3: Advanced Filtering Array, get the most out of the Filter array action.
This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy – live Power Platform workshops, free or CHF 49. Join the workshop waitlist to get notified about new dates. For companies that want this implemented for them, see KMUpower – Power Platform consulting & automation for SMEs (DACH).