Zero results on using 'is included in' with dynamic parameters such as $(instance/vars/@myVariable) | Community
Skip to main content
bhaskarc1289447
Level 3
April 5, 2022
Solved

Zero results on using 'is included in' with dynamic parameters such as $(instance/vars/@myVariable)

  • April 5, 2022
  • 1 reply
  • 707 views

Hi All

 

In myVariable, it has comma separated data. Example:  apple,orange,banana

 

when I use the query activity

 

fruits ---> is included in --> $(instance/vars/@myVariable), I am getting zero results. 

 

is it possible to use 'is included in' with $(instance/vars/@myVariable) in query activity or there is any alternate way to do that as myVariable will always have more that 2-3 data.

 

also there are multiple query conditions together. For example :

       fruits ---> is included in --> $(instance/vars/@myVariable)

and vegetables ---> is included in --> $(instance/vars/@myVariable2)

 

please help

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Marcel_Szimonisz

Hello @bhaskarc1289447,

The thing your variable has to translate to '1','2', but you provide it  as '1,2' instead.

 

There is a small trick that can achieve what you want and it is to modify the condition field from the advanced tab of the query activity:

 

//expr="@firstName IN ('1', '2')
vars.incond = "'1','2','3'";
activity.where[0].condition[0].condition.expr = "@firstName IN (" + vars.incond + ")";
//condition[0] means that its first condition

Result :

PS: do not worry about the computed string that still shows old version.

 

 

1 reply

Marcel_Szimonisz
Community Advisor
Marcel_SzimoniszCommunity AdvisorAccepted solution
Community Advisor
April 6, 2022

Hello @bhaskarc1289447,

The thing your variable has to translate to '1','2', but you provide it  as '1,2' instead.

 

There is a small trick that can achieve what you want and it is to modify the condition field from the advanced tab of the query activity:

 

//expr="@firstName IN ('1', '2')
vars.incond = "'1','2','3'";
activity.where[0].condition[0].condition.expr = "@firstName IN (" + vars.incond + ")";
//condition[0] means that its first condition

Result :

PS: do not worry about the computed string that still shows old version.