Advanced Code to create a "LIKE" or "IN" condition | Community
Skip to main content
maurizio_coro
Level 3
July 9, 2018
Solved

Advanced Code to create a "LIKE" or "IN" condition

  • July 9, 2018
  • 2 replies
  • 2780 views

Hi everyone,

I know that to configure manually a where condition inside and activity I can use this code to refer to global viariable:

activity.where[0].condition[1].expr = "@language = '" + vars.lang + "'";

I'm wondering if there's a way to check the value with a LIKE command

for IE: if my vars.lang is "en,de,it" and I'd like to select all the recipient who have @language = "en" or "de" or "it".

Thanks a lot!

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 Amit_Kumar

Hey,

Use below.

vars.langs = "'en','de','it'";

activity.where[0].condition[1].expr = "@language IN ( " + vars.langs  + ")";

This will solve your problem.

2 replies

July 10, 2018

Hi mate,

Just checking as it wasn't clear from your message; would you want to be able to use the 'included in' or the 'like' operation.

Going off your example I would image you will need the included in operation, if so give the following a try:

     "@language IN ('en', 'de', 'it')"

Good luck!

Amit_Kumar
Amit_KumarAccepted solution
Level 10
July 30, 2018

Hey,

Use below.

vars.langs = "'en','de','it'";

activity.where[0].condition[1].expr = "@language IN ( " + vars.langs  + ")";

This will solve your problem.