- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2021 09:07 AM
Hi All,
How can we check if the approvals are either approved or rejected and all the catalog tasks are closed completed or closed cancelled in flow designer? We need to wait till all the approvals are either approved or rejected before moving future in flow designer
Thanks in advance
Vidya Shree
Solved! Go to Solution.
- Labels:
-
flow designer
- 5,667 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2021 02:47 AM
Hi
try the follow approach. After passing all approval step iterate over the child task and wait until each task is inactive
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 12:01 PM
I just walked through the above process. In the data pill picker, there should be a Catalog Task Record under the For Each. This is what you want. It will also populate Table to Catalog Task [sc_task].
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 10:44 AM
@Maik Skoddow I have No action for Record update in the Flow designer, But my request is getting closed when one of the Sc_task is getting closed. Where can i place the wait for conditions before the catalog task creation or after the task creation in flow designer. I am creating two task in the flow designer after the approval is approved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2021 07:15 AM
Hi,
Please follow below steps to achieve your requirement:
1) You can make use of Action "Wait for Condition" and use the script below for reference which checks for any Approval in Requested state or not and also at the same time checks for any Catalog Task present in Closed complete state or not:
/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
**
**Requires GlideRecord encodedQuery response, example:
**"active=true^short_descriptionSTARTSWITHtest";
*/
var getRITM = fd_data.trigger.current.sys_id;
var checkApproval = checkApprovals(getRITM);
var checkTask = checkCatalogTask(getRITM);
var ans;
var ans1;
function checkApprovals(getRITM){
var app = new GlideRecord('sysapproval_approver');
app.addQuery('sysapproval',getRITM);
app.query();
while(app.next()){
if(app.state == 'requested'){
ans = true;
}else{
ans = false;
}
}
return ans;
}
function checkCatalogTask(getRITM){
var gr1 = new GlideRecord('sc_task');
gr1.addquery('request_item',getRITM);
gr1.query();
while(gr1.next()){
if(gr1.state == 'Put your value of Close Complete here' || gr1.state =='Put your other value to check'){
ans1 = true;
}else{
ans1 = false;
}
return ans1;
}
if(checkApproval == true || checkTask == true){
return true;
}else{
return false;
}
}
Sample Flow for reference attached below where I am having an approval and also a Catalog task and then using the Wait for Condition :
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke