Expand my Community achievements bar.

SOLVED

Variable Wait activity time

Avatar

Level 7

CampaignerForLife_1-1679488291914.png

Is there any way to do this? Instead of a number (Like, 5s) set it to be a value generated in the workflow

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @CampaignerForLife ,

You can replace wait activity with JavaScript Code Activity, and insert the below script

instance.vars.WaitTime = 5000;

task.wait(instance.vars.WaitTime);

ParthaSarathy_0-1679489962086.png

 

Or By using Wait Activity > Advanced tab's Initialization script > add the same code, and Define duration as 0s in Wait tab.

 

ParthaSarathy_1-1679490076334.png

 

ParthaSarathy_2-1679490089491.png

 

ParthaSarathy_3-1679490103176.png

 

View solution in original post

2 Replies

Avatar

Community Advisor

Hello @CampaignerForLife 

 

If you have a single wait activity then you can use this code in a javascript activity before the wait activity.

instance.activities.wait[0].delay=TIME_IN_SECONDS;

 


     Manoj
     Find me on LinkedIn

Avatar

Correct answer by
Community Advisor

Hi @CampaignerForLife ,

You can replace wait activity with JavaScript Code Activity, and insert the below script

instance.vars.WaitTime = 5000;

task.wait(instance.vars.WaitTime);

ParthaSarathy_0-1679489962086.png

 

Or By using Wait Activity > Advanced tab's Initialization script > add the same code, and Define duration as 0s in Wait tab.

 

ParthaSarathy_1-1679490076334.png

 

ParthaSarathy_2-1679490089491.png

 

ParthaSarathy_3-1679490103176.png