Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Filter „is included in“ with variable that has a list of values

michaelk5974358
Level 2
Level 2

Hello

I try to use the filter „is included in“ with a variable like $(vars/@zzz) that in a javascript activity is written like vars.zzz.

It works if I only have one content, but it does not work when I used several contents comma separated like

aaa,bbb,ccc

I also tried the following alternatives without success:

'aaa,bbb,ccc'

'aaa','bbb','ccc'

('aaa,bbb,ccc')

('aaa','bbb','ccc')

Any proposal for solution?

Michael

1 Accepted Solution
Jean-Serge_Biro
Correct answer by
Community Advisor
Community Advisor

Hi Michael,

Yes, it is well-known limitation of the Query,Enrichment, DImension change, etc workflow activities. The wizard code generates this syntax:

IN ('v1,v2,v3')

instead of:
IN ('v1','v2','v3')

clause

given the variable value is: v1,v2,v3

There is no problem with the wizard if the values are typed, only when using variables.

So the only workaround is to replace the Query activity (or Enrichment etc) by a Query def; for instance in a webApp, the webApp var containing a list with values separated by commas, is put in the queryDef where clause as is:

"[XXX/@ID] IN (" + ctx.vars.sTypeList + ")"

Hope it could help.

Regards
J-Serge

View solution in original post

3 Replies
Jean-Serge_Biro
Correct answer by
Community Advisor
Community Advisor

Hi Michael,

Yes, it is well-known limitation of the Query,Enrichment, DImension change, etc workflow activities. The wizard code generates this syntax:

IN ('v1,v2,v3')

instead of:
IN ('v1','v2','v3')

clause

given the variable value is: v1,v2,v3

There is no problem with the wizard if the values are typed, only when using variables.

So the only workaround is to replace the Query activity (or Enrichment etc) by a Query def; for instance in a webApp, the webApp var containing a list with values separated by commas, is put in the queryDef where clause as is:

"[XXX/@ID] IN (" + ctx.vars.sTypeList + ")"

Hope it could help.

Regards
J-Serge

View solution in original post

salvdangelo
Level 5
Level 5

Hi Jean-Serge,

What should I do if I have to extract data with this kind of filter (so I cannot use a Query activity) in a CSV file and save it in a AC SFTP folder?

Usually I would use a "Data extraction" activity but this one needs an inbound population.

Could you explain me how to do this?

Thanks in advance,

Salvatore