- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 02:50 AM
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 ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 03:09 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 03:23 AM
are you saying approval for RITM based on choice value of variable?
if yes then check this on how to have scripted approval in flow
Flow Designer Approvals Overview - Workflow Automation Center of Excellence
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 04:02 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 03:16 AM
I have 16 choices with 7 different approvers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 03:19 AM
Can I use inline script for approver also ? If so, how can I retrieve approver name in flow ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2023 03:50 AM
HI @sravya vemula ,
I trust you are doing great.
Here's a high-level solution to achieve this:
Create a Business Rule:
- Navigate to "Business Rules" in the ServiceNow Studio or the application menu.
- Create a new business rule and set the appropriate conditions to trigger it when the select box variable is updated.
- In the script, based on the selected value, set the assignment group or the individual assignee for the approval task and the service catalog task.
- Save and activate the business rule.
Create a Workflow:
- Navigate to "Workflows" in the ServiceNow Studio or the application menu.
- Create a new workflow and configure it to trigger when the approval task is created.
- Define the required activities/states in the workflow, such as approval steps, task assignments, etc.
- For each activity, set the assignment group or individual assignee dynamically based on the value selected in the select box variable.
- Save and publish the workflow.
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi