Skip to main content
Community site session details

Community site session details

Session Id : HxZlBfajGdtCpWunk0GF0P
Power Automate - Building Flows
Answered

Syntax on filter query

Like (0) ShareShare
ReportReport
Posted on 27 Apr 2021 14:59:56 by

 

 

I am running into this issue in my Filter query: 

 

 

')' or ',' expected at position 26 in 'contains(cr079_name,'Lowe's Companies Inc')'.

 

 

 

I am trying to get rows based on this filter query: "contains(cr079_name,'@{items('For_each_Report_Details')?['cr079_entityname']}')"

 

I also have this action wrapped with an "apply for each" action. The overall aim is to filter that list so I can do something with it.

 

Any helps?

flowchart.PNG

 

 

  • Paulie78 Profile Picture
    8,416 Moderator on 28 Apr 2021 at 17:56:46
    Re: Syntax on filter query

    Looks a bit crazy, but this should do it:

    (contains(cr079_name,' @{replace(if(equals(items('For_each_Report_Details')?['cr079_entityname'], null), '', items('For_each_Report_Details')?['cr079_entityname']),'''','''''')}' )) OR (cr079_ticketsymbol eq '@{replace(if(equals(items('For_each_Report_Details')?['cr079_ticketsymbol'], null), '', items('For_each_Report_Details')?['cr079_ticketsymbol']),'''','''''')}')
  • Community Power Platform Member Profile Picture
    on 28 Apr 2021 at 17:43:00
    Re: Syntax on filter query

    This is what it looks like now

    (contains(cr079_name,' @{replace(items('For_each_Report_Details')?['cr079_entityname'],'''','''''')}' )) OR (cr079_ticketsymbol eq '@{replace(items('For_each_Report_Details')?['cr079_ticketsymbol'],'''','''''')}')
  • Paulie78 Profile Picture
    8,416 Moderator on 27 Apr 2021 at 21:37:31
    Re: Syntax on filter query

    Then you are going to have to do an even more elaborate expression to replace the null with an empty string. Can you paste me the expression you used and I will rewrite it for you.

  • Community Power Platform Member Profile Picture
    on 27 Apr 2021 at 21:24:57
    Re: Syntax on filter query

    It seems to work. thank you but now I am running into the problem: 

    One or more fields provided is of type 'Null', a different type is expected.

     

    seem].PNG

     

  • Community Power Platform Member Profile Picture
    on 27 Apr 2021 at 20:38:23
    Re: Syntax on filter query

    What do you mean? Replace the contain function with the replace function? 

  • Verified answer
    Paulie78 Profile Picture
    8,416 Moderator on 27 Apr 2021 at 15:14:13
    Re: Syntax on filter query

    I think you are going to have to do something like this:

    replace(items('For_each_Report_Details')?['cr079_entityname'],'''','''''')

    in your filter rows action.

     

  • Paulie78 Profile Picture
    8,416 Moderator on 27 Apr 2021 at 15:10:29
    Re: Syntax on filter query

    It would appear that the "Entity" name contains a single quote which is being interpreted in the filter query, and therefore making the syntax incorrect.

     

    I'm not sure of the solution, you might have to URLEncode the single quote or replace it with \' or perhaps double quotes. But that is what is causing your problem.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete