Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Javascript

Avatar

Level 5

How can i do a Split in javascript code?

 

please help

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Should be pretty straight forward, perhaps in the example I provided I forgot to enclose the value in quotes.

var language = English;

David__Garcia_1-1680088444200.png

 

David__Garcia_0-1680088400458.png

 

 

 

View solution in original post

7 Replies

Avatar

Community Advisor

Hi @alnavarg 

 

Could you please explain a bit more here.

As you can use conditional statements for fetching the desired records based on your filtering criterias.

 

Regards

A

Avatar

Level 5

i like to know how can i do a split in js code to do a selection from deliveries depends on the laguage of the recipient

Avatar

Community Advisor

I believe this may be what you are after, using advanced javascript, you can create multiple transitions and activate whichever one meets the condition.

 

var language = English;

if(language == "English"){
  task.postEvent(task.transitionByName('english')); 
} else {
  task.postEvent(task.transitionByName('other'));
}

 

Avatar

Level 5

We have problems with the postEvent, in the log puts invalid argument 

What we need to write in there?

Avatar

Correct answer by
Community Advisor

Should be pretty straight forward, perhaps in the example I provided I forgot to enclose the value in quotes.

var language = English;

David__Garcia_1-1680088444200.png

 

David__Garcia_0-1680088400458.png

 

 

 

Avatar

Level 5

Thanks and this helps me in split a delivery in diffrents languages?

 

Like this Query --> Javascript --> delivery ???