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 / Correct use of "substr...
Power Automate
Unanswered

Correct use of "substringof"

(0) ShareShare
ReportReport
Posted on by 340

Hi guys,

 

I am trying to filter a "Get Items" action using substringof. Is it possible to substitute the condition value with a variable rather than hard text? So for example, instead of:

 

substringof('help with printer',Title)

we use a variable like this (email subject line):

substringof(triggerBody()?['subject'],Title)

or:

substringof(variables('subject'),Title)

This is the flow:

da1ve_0-1676854897263.png

Hoping to use the filter query within the Get items action

 

Thanks,
David

 

Categories:
I have the same question (0)
  • v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @da1ve ,

     

    Please try:

    vdezhilimsft_0-1676864761930.png

    vdezhilimsft_1-1676864782717.png

    vdezhilimsft_2-1676864801398.png

    vdezhilimsft_3-1676864847106.png

     

    Best Regards,

    Dezhi

     

     

     

     

  • sofiang Profile Picture
    14 on at

    Hi,

     

    You could use variables for both column and search term. The important part is to put quote marks surrounding the text to search for.

     

    sofiang_0-1676869345468.png

     

    Cheers 🙂

     

  • da1ve Profile Picture
    340 on at

    Hi @sofiang & @v-dezhili-msft ,

     

    Thanks for your help. It seems it either isn't working as expected or my scenario wont work. So if I look at my trigger action, the subject is "re: bnm"

     

    da1ve_0-1676871651038.png

     

    Then on my filter query I am using:

     

    da1ve_1-1676871701969.png

     

    Which shows the correct data:

     

    da1ve_2-1676871731623.png

     

    But the outputs show nothing:

     

    da1ve_3-1676871749382.png

     

  • v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @da1ve ,

     

    Is your flow wrong?
    If there is no error, it seems that there is no record containing "re:bnm" in the Title column in your list.
    Could you please show some data for the Title column in your list?

     

    Best Regards,

    Dezhi

  • da1ve Profile Picture
    340 on at

    @v-dezhili-msft ,

     

    So the title column has an entry of "bnm"

     

    da1ve_0-1676872269201.png

     

    What I'm trying to achieve is filter out the records containing text. So when a new email is received and the subject of the email is "re: bnm" - I want the filter query to match the title record (bnm) because the email subject contains text of the title column (not an exact match).

     

    Hope that makes sense?

     

  • Verified answer
    v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @da1ve ,

     

    Unfortunately, if the second parameter of substringof in the filter query is the column name, the record that contains the first parameter in the column is found.
    If you want to find the fields contained in the string, I suggest you use filter array to achieve.

    vdezhilimsft_0-1676874152078.png

    vdezhilimsft_1-1676874169870.png

    vdezhilimsft_2-1676874191606.png

    vdezhilimsft_3-1676874223108.png

     

    Best Regards,

    Dezhi

     

     

     

     

  • da1ve Profile Picture
    340 on at

    Thank you @v-dezhili-msft that worked perfectly

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