Help with Flow Designer Script

Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 06:41 AM
Hi,
I have a requirement where Short Description should be auto populated based on the selection. Currently it is showing as () instead of value inside. Kindly help.
/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**Order number is offset by +1 in Error Handling Section.
**Available options display upon pressing "." after fd_data
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
var action = fd_data._1__get_catalog_variables.action;
var requested_for = fd_data._1__get_catalog_variables.requested_for_user.sys_id;
var service_account_string = fd_data._1__get_catalog_variables.service_account_s; //string
var service_account_arr = service_account_string.split(","); //array
var service_account_name_arr = [];
for(var i = 0;i<=service_account_arr.length;i++)
{
var gr = new GlideRecord('u_cmdb_ci_unix_service_account');
gr.addQuery('sys_id',service_account_arr[i]);
gr.query();
if(gr.managed_by != " "){
while(gr.next())
{
if(gr.managed_by != requested_for){
service_account_name_arr.push(gr.managed_by.name.toString());
}
}
}
}
var msg = "Next step: Your request requires approval from IT Manager(s) - " + service_account_name_arr;
return msg;
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 06:52 AM
Hi @Community Alums,
Please let me know if you are available for a quick call to fix this issue as I require few more details from your end to fix this issue.
Thanks and Regards,
K. Sai Charan
Sr. ServiceNow Developer
Deloitte India