- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2021 10:23 AM
Hi,
I need help on how to populate assignment group based on user select dropdown variable value that contains pacific word using Flow Designer f(x) script.
This is what I have, but it did not work. Can someone please provide suggestion. Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2021 12:06 PM
If using Flow anyway, why not use Decision Tables? You can then create a completely code free solution.
Define the decision table that accepts a text input to use in the condition:
AAnd the condition:
Then use it in the flow:
Using a Catalog Item variable as below:
And finally update the assignment group:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2021 12:09 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2021 12:14 PM
Just confirming here, everything you have hardcoded here so why you need script ?
If i see your script , TeamName variable holding hardcoded value 'Outlook App'
so why you need script ?
var av ='';
var TeamName = 'Outlook App';
gs.log('index of check '+ TeamName.indexOf('Outlook'));
if(TeamName.indexOf('Outlook') > -1){
gs.log('Value inside if ');
av += 'IT Service Desk Team';
}
return av;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2021 12:19 PM
use below line and see if it went to if block or not
if(TeamName.indexOf('Outlook') > -1){
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2021 01:27 PM
I have also tried your suggestion code and it works as well, but it populated the value as a dropdown list instead. Is is not showing the value inside the Assignment Group field. End users needs to select the value from the dropdown list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2021 10:38 AM
Hi Erica
use != operator
Reference links:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_inequality
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP