The CreatorCon Call for Content is officially open! Get started here.

Wait for condition in workflow

anvitha ash
Tera Contributor

Hi,

 

I need to add wait for condition activity in workflow

 

There is a run script activity which is creating a ritm(kick off other catalog item), once that ritm state gets closed complete then it should move to next activity 

 

When the ritm state gets closed complete then only it should move to next activity, untill then it should wait 

 

How can we achieve this functionality

 

Can someone help me here 

 

Thanks in advance 🙂

8 REPLIES 8

Samaksh Wani
Giga Sage

Hello @anvitha ash 

 

You can add Wait for Condition, In it you can select state field , state is closed complete, after that add your task that you wanna execute.

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.

 

Regards,

Samaksh

Hello @Samaksh Wani ,

 

Thanks for sharing your response

 

I have written the script but it's not working as expected

 

//Script written in "Wait for condition" activity

var gr = new GlideRecord('sc_req_item');
gr.addEncodedQuery("request=" + workflow.scratchpad.request);
gr.query();
if(gr.next()){
if (gr.state == '3' || gr.state == '4' || gr.state == '7'){
answer = true;
}
}

Sohail Khilji
Kilo Patron

@anvitha ash , 

 

In the workflow you can use the activity 'Wait for Condition'' which will let you wait for the completion of RITM Until its closed complete, you can also consider using flow designer ''wait for condition'' for the same.

 

SohailKhilji_0-1691393547122.png

 

I hope this helps !

 

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi @Sohail Khilji ,,

Thanks for sharing your response

 

 

//Script written in "Wait for condition" activity

 

var gr = new GlideRecord('sc_req_item');

gr.addEncodedQuery("request=" + workflow.scratchpad.request);

gr.query();

if(gr.next()){

if (gr.state == '3' || gr.state == '4' || gr.state == '7'){

answer = true;

}

}

 

I have this script but it's not working