Auto populate approver name based on the selection of a variable value

sravya vemula
Tera Contributor

Hi Team,

I am working on a requirement where there is a select box variable with 16 question choices.

I need to assign the approval task to various people based on the value selected in the select box. 

I have tried doing this in flow designer but it all became clumpsy and thereafter I also need to assign the sctask to various groups based on the select box value. Could you help out here ?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@sravya vemula 

you can use inline script for group field while you create the catalog task via flow

in that script check value of that choice variable and accordingly set the group sysId

var val = fd_data.trigger.request_item.variables.variableName;

if(val == 'choiceValue1')
return 'groupSysId1';
else if(val == 'choiceValue2')
return 'groupSysId2';

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@sravya vemula 

you can use inline script for group field while you create the catalog task via flow

in that script check value of that choice variable and accordingly set the group sysId

var val = fd_data.trigger.request_item.variables.variableName;

if(val == 'choiceValue1')
return 'groupSysId1';
else if(val == 'choiceValue2')
return 'groupSysId2';

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Thanks for your reply.

May I know how can I auto assign the approval task based on the selection of select box variable ?

@sravya vemula 

that's what I shared above how to assign group based on choice

what else is required?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes. I got the Group part. But how to assign the approval tasks to approvers from sys_user ?