How do we pass more than one value(array) of values from a variable into a filter condition of subsequent query activity | Community
Skip to main content
New Participant
Feb 7, 2020 6:56 PM UTC
Solved

How do we pass more than one value(array) of values from a variable into a filter condition of subsequent query activity

Hello,

 

Can we pass multiple values from a variable in JavaScript activity into filter criteria of subsequent query activity.

Tried using "is Included in" but all the values from Variable are being read as single value inside the filter criteria of query activity.

How can we have read all them separately, any suggestions appreciated !

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Raj_Ganta-1
Raj_Ganta-1Accepted solution
Level 5
Feb 7, 2020 8:55 PM UTC

Hi,

 

Can you try the below code once?

 

var id = [] var res = query.getElementsByTagName("{{schema name}}") for each (var w in res){ id.push("'"+w.getAttribute("attribute name")+"'"); } vars.idArray = id.join(",").slice(1,-1); logInfo(vars.idArray);

 

 

if it is a string that is in filter criteria should use $noescaping(vars/@idArray) in it.

 

4 replies

Level 2
Feb 9, 2020 4:30 AM UTC

Hi,

You can define your variables in two(or more) separate variables in javscript activity and then in query activity use two(or more) different conditions with OR operator(separate condition for every variable with same column of table). I think this should work if i understood it correctly.

 

Regards

Translate
Raj_Ganta-1
Raj_Ganta-1Accepted solution
Level 5
Feb 7, 2020 8:55 PM UTC

Hi,

 

Can you try the below code once?

 

var id = [] var res = query.getElementsByTagName("{{schema name}}") for each (var w in res){ id.push("'"+w.getAttribute("attribute name")+"'"); } vars.idArray = id.join(",").slice(1,-1); logInfo(vars.idArray);

 

 

if it is a string that is in filter criteria should use $noescaping(vars/@idArray) in it.

 

Translate
Employee
Nov 23, 2020 7:37 AM UTC
This works. Thank you
Translate