How to update RITM work notes with the old and new field values throuh flow designer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 10:37 AM
RITM work notes should be updated with the all the fields when we make the changes on the catalog fields and it should be in the below format.
"The fieldname is changed from old value to new value"
Please find the below catalog form fields :
when we are trying to update one field Group Manager value from "Chloe Campbell" to 'Karthik C", the RITM work notes should be updated with the below format.
The Group is updated:
Group Name CISO GLBL ACTIVE DIRECTORY INFRASTRUCTURE APPROVAL
The Group Manager is changed from Chloe Campbell to Karthik C.
The Description is changed from old value to old value(even they have not changed Description) like this for all the fields.
Now the RITM work notes is updated with the current value only (updated Group Manager value)
Please see the below existing flow designer configuration.
Please help me how do we can make the changes in flow designer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2025 04:20 PM
Greetings,
I have personally never done this and when I researched Flow Designer "previous values" I found a ServiceNow Knowledge Base article that states Flow Designer is not the best use-case for capturing current and previous values. They recommend a Business Rule which has access to current and previous. If you were interested in a low-code solution you could create a Subflow with inputs for: ticket number, field name, previous value, and current value. You could then create a simple Business Rule that captures those values from the ticket the change is made on and then calls the Subflow and passes those 4 parameters/inputs.
Can flow designer determine the previous and current value of a field? - Support and Troubleshooting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2025 03:01 AM
Hi @Suresh_32 ,
You have to use after Business Rule, so that you can bring the previous and current value of a variable.
I don’t think from Flow you can get the previous value of variable.
If my response helped, then please accept the solution and hit thumbs up. This will help future readers as well.
Regards,
Rohit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2025 09:03 AM
Thank you for your reply Rohit,
If possible, could you please send me with the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2025 08:07 PM
Not possible using flow designer
for that please use before update business rule on sc_req_item table
Condition: current.cat_item.name == 'Your Item Name' && current.variables.changes()
Script:
(function executeRule(current, previous /*null when async*/ ) {
var question, prv1, cur1;
var cur = current.variables.getElements();
var pvr = previous.variables.getElements();
var arr = [];
for (var i = 0; i < cur.length; i++) {
if (cur[i] != pvr[i]) {
question = cur[i].getQuestion().getLabel();
cur1 = cur[i]; // current value
prv1 = pvr[i]; // previous value
var str = 'The ' + question + 'has changed from ' + prv1 + ' to ' + cur1;
arr.push(str + '\n');
}
}
current.work_notes = arr.toString();
})(current, previous);
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