- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 01:03 AM - edited 03-12-2025 01:09 AM
Hi Everyone,
-I am creating an assets task in Flow Designer where the trigger condition is set to on field Assigned to "changes" on the Configuration Item (cmdb_ci) table. I want to map the previous value of the Assigned to field from the Configuration Item (cmdb_ci) table.
-For this, I initially tried using a no-code solution, but I believe it's not possible. Therefore, I have created the script below:
auditRecord.setLimit(1); // Only need the most recent audit record for the change
However, I'm not getting the previous value of Assigned to; it is returning null. Can anyone help me with the correct code to retrieve the previous value?
Solved! Go to Solution.
- Labels:
-
ryone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 02:30 AM
Hi @rmaroti , you can achieve this without code, you can loop the changed fields array object-
and then we can check if the changed field is 'assigned_to' -
then you can set the field to the previous value -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 02:30 AM
Hi @rmaroti , you can achieve this without code, you can loop the changed fields array object-
and then we can check if the changed field is 'assigned_to' -
then you can set the field to the previous value -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 03:15 AM
Flow designer provides you list of Changed Fields with previous and current value
Simply use that Array of Objects and iterate
better explanation here
Using the data within the "Changed Fields" Pill
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
04-10-2025 04:54 AM
As per new community feature you can mark multiple responses as correct.
If my response helped please mark it correct as well so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader