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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

maurizio_coro
Level 3
Level 3

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!

1 Accepted Solution
Amit_Kumar
Correct answer by
Community Advisor
Community Advisor

Hey,

Use below.

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

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

This will solve your problem.

View solution in original post

2 Replies
AC_King
Level 1
Level 1

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
Correct answer by
Community Advisor
Community Advisor

Hey,

Use below.

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

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

This will solve your problem.

View solution in original post