How to populate assignment group using Flow Designer f(x) script?

Erica2
Tera Contributor

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

find_real_file.png

1 ACCEPTED SOLUTION

-O-
Kilo Patron
Kilo Patron

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:

find_real_file.png

AAnd the condition:

find_real_file.pngThen use it in the flow:

find_real_file.png

Using a Catalog Item variable as below:

find_real_file.png

And finally update the assignment group:

find_real_file.png

View solution in original post

25 REPLIES 25

Harsh Vardhan
Giga Patron

Did you add log to check either its going inside if block or not? 

@Harshvardhan 

How do you add log to check.  I have never done it.  Could you help?

For testing purposes.  Here is my f(x), but it did not work.

 

var av ='';
var TeamName = 'Outlook App';

if(ProjName.indexOf('Outlook') ==-1){
av += 'IT Service Desk Team';
}
return av;

 

@Harshvardhan 

Sorry, this should be the correct code
 
var av ='';
var TeamName = 'Outlook App';

 

if(TeamName.indexOf('Outlook') ==-1){
av += 'IT Service Desk Team';
}
return av;

Added logs please check now. 

 

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;