- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 08:20 AM
Hello everyone,
I’m working on a requirement where all newly created cases should be automatically assigned to employees in the relevant department, instead of assigning them manually.
To achieve this, I’ve implemented a Flow Designer solution:
Step 1: I used a Lookup Records action to fetch employees based on certain conditions (like matching department and lowest current load). This part is working correctly, and I’m getting the desired output.
Step 2: I now need to update the original case record (in another table) based on the employee retrieved in Step 1. Specifically, I want to set the assignedto field with the sys_id of the selected employee and optionally update their.
I’m facing difficulty in creating a Script Action to perform this update logic inside Flow Designer. I’d appreciate any guidance or examples on how to correctly implement this using a Script step or alternative method.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 10:00 AM
Hi @saibhanuala ,
you can use the Look Up record action instead of (look up records action)
with department condition
where table name is employee table name and order by current_load (a to z) low to high
here is an example on the incident table
you can use the datapill and directly set the assigned on from the lookup record action
with look up records action you have to use for each action to access but with this you don't need extra step and your requirement suites it
hope this make sense
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 08:49 AM
If it is upon creation, don't you have there any action where do you populate short description or any other details, assignment group could be one more of it.
Or alternatively, you can use Assignment rules or a script field on the particular Case (eventually record producer).
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 09:00 AM
Hi @saibhanuala ,
This can be achieved directly without using script also. You can utilize the if employee in department found->true-> assign the employee sys_id from data pills to respective case-> end . This will be much smoother and easier. If i miss something, pls attach the snippet for better coverage of answer.
If this helped you, pls mark this as helpful and accepted.
Thanks,
Pankaj Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 09:07 AM
You can use "Update Record" flow action and set the Assigned To as Output from Step 1
share screenshots.
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-21-2025 09:44 AM
Use Case:
I have a table named ContactandSupport which stores reports raised by customers through my app. From the frontend, fields like Department and Subject are submitted by the user. There's also an AssignedTo field, which is a reference to another table called Employees.
Employees(Table)
What I've Done So Far:
I used the Look Up Records action in Flow Designer to fetch a set of employees belonging to the selected department.
I am able to retrieve this list successfully using a Data Pill.
Issue I'm Facing:
Now that I have the list of employees, I want to update the AssignedTo field in the original report with one of these employees (preferably the one with the lowest current_load). However, I’m not sure how to take the output of the Lookup Records step and use it to update the record.
Test