Skip to main content

Hi all,

 

I have implemented the following sheet filter statement, which only applies a filter if at least one value is in a variable (selected through a dropdown):

 

<% if(customer_selection != "") { %>

 

FILTER whatever;

 

<% } %>

 

 

----------------

 

However, when I try to add another statement like the above for a second variable within the same sheet load script, then NONE of the two conditional filter statements work.

 

Can someone provide me with the correct syntax to define multiple of the above conditional filter statements in one sheet load script?

 

 

 

-------------------------

 

 

A second question is whether it is possible and if yes what the correct syntax is to define a conditional filter statement like the following:

 

<% if(search_pattern_selection LIKE "XYZ") { %>

FILTER whatever;

<% } %>

 

Thus, not testing for emptiness but testing with a LIKE comparer if certain values are in a variable.

 

 

 

@david.beche12​ any input on the two questions?

 

 

Thanks and Best,

 

Florian

Quick follow-up on this. can anybody help out here?

 

@gabriel.okaba11 ?

@david.beche12 ?

 

:)


Hi @florian.hoerl12 ,

Celopeers is an open community. If you need direct support that is time-sensitive, please use the Partner Portal (Click on Connect->Technical Advisory) and schedule a session. For further questions on the feature, you can always connect with your Partner Delivery Manager.

 

image" data-fileid="06907000007U4jNAAS 

Best,

Gabriel


Hi @florian.hoerl12 

 

Hope you're doing well.

 

You can try this:

 

<% if(variable.indexOf("XYZ") > -1) { %>

FILTER ...

<% } %>

 

Note that we don’t officially support JS as part of PQL, so we recommend checking your results and cannot guarantee there are no bugs if you do use JS in your filters.

 

Best,

Mentor


Reply