cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kobinaof2
Regular Visitor

Syntax on filter query

 

 

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User III
Super User III

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.

 

View solution in original post

7 REPLIES 7
Paulie78
Super User III
Super User III

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.

Paulie78
Super User III
Super User III

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.

 

View solution in original post

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

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

 

Paulie78
Super User III
Super User III

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.

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
Super User III
Super User III

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']),'''','''''')}')

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (3,334)