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

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

Avatar

Avatar
Give Back
Level 2
maurizio_coro
Level 2

Likes

15 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 3
Ignite 1
Validate 10
Validate 1
View profile

Avatar
Give Back
Level 2
maurizio_coro
Level 2

Likes

15 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 3
Ignite 1
Validate 10
Validate 1
View profile
maurizio_coro
Level 2

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
Validate 10
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct Reply

231 solutions
Top badges earned
Validate 10
Validate 1
Establish
Give Back 50
Give Back 5
View profile

Avatar
Validate 10
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct Reply

231 solutions
Top badges earned
Validate 10
Validate 1
Establish
Give Back 50
Give Back 5
View profile
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
Boost 1
Level 1
AC_King
Level 1

Like

1 like

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
AC_King
Level 1

Like

1 like

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
AC_King
Level 1

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!