web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help with Get Items qu...
Power Automate
Unanswered

Help with Get Items query for contains or substringof

(1) ShareShare
ReportReport
Posted on by 30
I have a flow that when an email is received the senders address is checked against a SharePoint list with a Get Items query. It is working using the code "EmailAddress eq '@{triggerOutputs()?['body/from']}'" , however there can be multiple email addresses from the same mail domain and the actions are the same for each domain so I just want to look at the email domain. I will modify the current list so the column will only contain the email domain then match the incoming email to the domain in the sender address. I have tried to use queries of both substringof  example substringof('triggerOutputs()?['body/from'],EmailAddress') and contains (no example) and I get an error when running that "the expression is not valid. Creating query failed." When I try to create the query in fx I do not see substringof as a value and when I try to build and add the query it is invalid and if I just type it in I get the error. 
Categories:
I have the same question (0)
  • Suggested answer
    rzaneti Profile Picture
    4,241 Super User 2025 Season 2 on at
    .Hi,
     
    For substringof, you must pass the substring that you want to find in the SharePoint List column as first parameter, and the SharePoint List column as second parameter. For example, to search for records that contains the value "ohn" in the Employeename column, I must use substringof('ohn', Employeename) as Filter Query.
     
    In the Filter query that you shared, it looks like you have an extra single quote after EmailAddress.
     
    Also, I'm sharing here an article that I recently wrote about how to work with filter query in Power Automate: http://digitalmill.net/2024/06/21/working-with-filter-query-in-power-automate/ 
     
    Let me know if it works for you or if you need any additional help!
    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.
  • donhsbht Profile Picture
    30 on at
    The reason that there was an extra quote was it was copied from the code view.
     
    If I try to enter the function via the editor I get this error
     
    If I just type it into the filter query I start by typing substringof then (' I use the lightning bolt to add the triggerbody from then I enter the colum name from the table and it allows me to save the query
     
     
     
    But when I run it, I get
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard