- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 04:29 AM
Hi Community,
I'm trying to add approvers in flow designer based on division here is the script but seems to be not working looking for some quick help
var requestorDept = fd_data._1__get_catalog_variables.v_division;
if (requestorDept == 'dept sys_id') { //
return "ApprovesAnyU[approver sys_id]"; //
} else if (requestorDept == 'dept sys_id') { //
return "ApprovesAnyU[approver sys_id]"; //
} else if (requestorDept == 'dept sys_id') { //
return "ApprovesAnyU[approver sys_id]"; //
} else if (requestorDept == 'dept sys_id') { //
return "ApprovesAnyU[approver sys_id]"; //
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 05:09 AM
Hello @Community Alums,
I had somewhat similar requirement where we used location table value to populate assignment group. I'll attach my code snippet below hope it helps.
var ritmSysId = fd_data.trigger.request_item.sys_id;
var rec = new GlideRecord('sc_req_item');
rec.get(ritmSysId);
var location = rec.variables.printer_location.primary_location.getDisplayValue();
var assignmentgrp;
gs.log('testing'+ location);
if(location == 'Location_1'){
assignmentgrp="sys_id1";
}else if(location == 'Location_2'){
assignmentgrp="sys_id2";
}return assignmentgrp;
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 05:09 AM
Hello @Community Alums,
I had somewhat similar requirement where we used location table value to populate assignment group. I'll attach my code snippet below hope it helps.
var ritmSysId = fd_data.trigger.request_item.sys_id;
var rec = new GlideRecord('sc_req_item');
rec.get(ritmSysId);
var location = rec.variables.printer_location.primary_location.getDisplayValue();
var assignmentgrp;
gs.log('testing'+ location);
if(location == 'Location_1'){
assignmentgrp="sys_id1";
}else if(location == 'Location_2'){
assignmentgrp="sys_id2";
}return assignmentgrp;
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 06:02 AM
Hi Sruthi thanks this approach works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 06:08 AM
Hi @Community Alums,
No worries happy to help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 05:17 AM
@Community Alums Did you see any errors in the log? What happens when the step with above script executes does it trigger any approval record?