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

Avatar

Avatar

maurizio_coro

Avatar

maurizio_coro

maurizio_coro

09-07-2018

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!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Amit_Kumar

MVP

Avatar

Amit_Kumar

MVP

Amit_Kumar
MVP

30-07-2018

Hey,

Use below.

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

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

This will solve your problem.

Answers (1)

Answers (1)

Avatar

Avatar

AC_King

Avatar

AC_King

AC_King

10-07-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!