Flow Designer to set assignment group based on variable value dynamically

olufsen
Kilo Sage

I am new to Flow Designer and I have been having issues how to dynamically change the catalog task assignment group based on a variable choice.

In my catalog item, I have 2 variables, Type (Select box) and Software. Now, depending on the chosen type, the catalog task will be assigned to a particular group. This is fairly straightforward but I am phasing up on Flow. Any help is appreciated.

Type: Option 1 -> Assignment Group: Service Desk

Type: Option 2 --> Assignment Group: Credit Group

Else: Assignment Group: Help Desk

var service = fd_data.trigger.current.variables.type;

if(service == 'ftp1'){
    task.assignment_group.setDisplayValue("Service Desk");
} else if(service == 'ftp2') {
    task.assignment_group.setDisplayValue("Credit Group");
} else{
task.assignment_group.setDisplayValue("Help Desk");
}

find_real_file.png

1 ACCEPTED SOLUTION

you can use get catalog variable action to get all variable details and then use this action variables in the create catalog task script it will look something like this

find_real_file.png

 

in the above screenshot i am passing 3 variables of standard laptop SR and now i will use acrobat variable in create catalog task action like this

find_real_file.png

so in your case u need to first get the catalog variable and then update your script something like this

 

var service = fd_data._1__get_catalog_variables.type;

if(service == 'ftp1'){

return "sys_id of group";

} else if(service == 'ftp2') {

return "sys_id of group";

} else{

return "sys_id of group";

}

View solution in original post

6 REPLIES 6

Vipul Sethi
Kilo Guru

you are using task object which is not valid in flow script, u can to return the sys_id of the groups like this

var service = fd_data.trigger.current.variables.type;

if(service == 'ftp1'){

return "sys_id of group";

} else if(service == 'ftp2') {

return "sys_id of group";

} else{

return "sys_id of group";

}

Thank you this works fine.

I tried do another test but it is not returning the correct groups. Can you help check my variables it seems that it is not getting the correct value to compare.

you can use get catalog variable action to get all variable details and then use this action variables in the create catalog task script it will look something like this

find_real_file.png

 

in the above screenshot i am passing 3 variables of standard laptop SR and now i will use acrobat variable in create catalog task action like this

find_real_file.png

so in your case u need to first get the catalog variable and then update your script something like this

 

var service = fd_data._1__get_catalog_variables.type;

if(service == 'ftp1'){

return "sys_id of group";

} else if(service == 'ftp2') {

return "sys_id of group";

} else{

return "sys_id of group";

}