Filter „is included in“ with variable that has a list of values | Community
Skip to main content
michaelk5974358
Level 2
March 6, 2018
Solved

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

  • March 6, 2018
  • 3 replies
  • 3735 views

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

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 Jean-Serge_Biro

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

3 replies

Jean-Serge_Biro
Jean-Serge_BiroAccepted solution
Level 10
March 6, 2018

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

michaelk5974358
Level 2
March 9, 2018

Thank you J-Serge,

it helped.

Michael

salvdangelo
Level 5
July 27, 2018

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