- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 01:01 PM
I have a catalog item variable of type Lookup Select Box called "Applications" that has about 20 choices in its dropdown list. This variable is pulling its options from a column in a custom table I created. In my workflow, I've tried using a switch to evaluate this variable, but it won't list the options. I've used switches in many of my workflows, but they have been for Select Box type variables and never for Lookup Select Box type variables. Is this not possible?
As a workaround, I tried resorting to the "If" condition in the workflow and going beyone the usual 'yes', 'no' options with the multiple options shown below, but have been unsuccessful in getting this to work.
Looking for any suggestions on getting either my Switch or If condition to work correctly. Thanks!
answer = check();
function check()
{
if(current.variables.application == 'Test 1') {
return 'test 1';
}
if(current.variables.application == 'Test 2') {
return 'test 2';
}
if(current.variables.application == 'Test 3') {
return 'test 3';
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 12:26 PM
I ended up being able to do this via the Run Script activity with conditions that match the activity.result.
if(current.variables.application == 'Test 1') {
activity.result = 'test 1';
}
if(current.variables.application == 'Test 2') {
activity.result = 'test 2';
}
if(current.variables.application == 'Test 3') {
activity.result = 'test 3';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 10:17 AM
I have confirmed with ServiceNow that Lookup Select Box type is not supported in the switch activity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 12:26 PM
I ended up being able to do this via the Run Script activity with conditions that match the activity.result.
if(current.variables.application == 'Test 1') {
activity.result = 'test 1';
}
if(current.variables.application == 'Test 2') {
activity.result = 'test 2';
}
if(current.variables.application == 'Test 3') {
activity.result = 'test 3';
}