Expand my Community achievements bar.

Adobe Campaign User Groups are live now. Join our Adobe Campaign User Groups and connect with your local leaders!
SOLVED

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

Avatar

Level 3

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

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @bhaskarc1289447,

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

Marcel_Szimonisz_0-1649246358308.png

Marcel_Szimonisz_1-1649246441597.png

 

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 :

Marcel_Szimonisz_2-1649247608235.png

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

 

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hello @bhaskarc1289447,

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

Marcel_Szimonisz_0-1649246358308.png

Marcel_Szimonisz_1-1649246441597.png

 

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 :

Marcel_Szimonisz_2-1649247608235.png

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