Script for task assignment based on selected zone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 06:48 AM
New to scripting
Please excuse my lack of knowledge as I'm still learning.
I have a drop-down field on the catalog form called > Device Location Zone (See pic 1).
I would like to build a script for the following :
1. When user selects Calgary in the list > Assign the sctask to Deskside Support - Calgary zone (Sys id = 5df87de993c28210ef61fbf08bba108d)
2. When user selects Edmonton in the list > Assign the sctask to Deskside Support - Edmonton zone (Sys id = b8ab37f6c399ae10886c5fd1b40131fe)
I tried but not sure if i'm doing the right steps. Can someone help me?
I tried writing a script in flow designer (See pic 2 and 3)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 09:28 AM - edited 05-27-2025 09:29 AM
If you are using get catalog variables action in flow designer and variables are selected then try this, make sure you have get catalog variables as first step, other wise change number of step in this line
fd_data._1__get_catalog_variables.device_location_zone.getDisplayValue()
like fd_data._2__get_catalog_variables.device_location_zone.getDisplayValue() , if this action is second step
var calgaryGroup = '5df87de993c28210ef61fbf08bba108d';
var edmontonGroup = 'b8ab37f6c399ae10886c5fd1b40131fe';
// Assign group based on selected location
if (fd_data._1__get_catalog_variables.device_location_zone.getDisplayValue() == 'Calgary') {
return calgaryGroup;
} else if (fd_data._1__get_catalog_variables.device_location_zone.getDisplayValue() == 'Edmonton') {
return edmontonGroup;
}
and share some screenshots of flow so i can see that if there is any other issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 09:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 09:55 AM
In script, return sys_id directly for testing and check if assignment group is populated
return '5df87de993c28210ef61fbf08bba108d';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 03:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 06:23 AM