Is it possible to revert the changes done by a flow?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
Hi,
One of our clients uses Flows to generate demand tasks and based on their completion, the Demand stage progresses. One of the end users has updated some of these demand tasks to Closed Skipped by mistake and this updated the parent Demand incorrectly.
Is there a way to undo any of the changes done by the user to avoid manually re-creating the demand and triggering the flow? Can the impacted demands be reinstated to the previous step in the flow?
Thank you 🙂
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
Hi @PaulaaO
Technically, yes — you can create a background script for small environments to bring the record back.
However, the main concern is that an email notification may be triggered, which needs to be suppressed.
Also, once a record is closed, it should not be reopened, so it's best not to follow this approach.
Instead, create a new record and follow the standard process.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
you cannot reinstate to the previous step in flow.
-> You will have to either manually correct or use some script to do that.
OR
-> Use a one-time server-side script or background script to reset demand stages as appropriate based on previous flow logic or business rules.
Something like this, but please enhance
var grDemandTask = new GlideRecord('dmn_demand_task');
grDemandTask.addQuery('sys_id', 'IN', 'sysId1,sysId2'); // give sysIds of those demand tasks which were accidentally marked as closed skipped
grDemandTask.addEncodedQuery('state=7'); // close skipped
grDemandTask.query();
while (grDemandTask.next()) {
// Reset stage to previous stage (modify field and value as per your setup)
grDemandTask.stage = 'previous stage value';
grDemandTask.setWorkflow(false); // avoid triggering any BR or notification on update
grDemandTask.update();
// now change the parent record as well
var demandRec = grDemandTask.parent.getRefRecord();
demandRec.field = 'previous value';
demandRec.setWorkflow(false); //avoid triggering any BR or notification on update
demandRec.update();
gs.info('Demand ' + grDemandTask.number + ' stage reset by script due to task closure correction.');
}
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
13 hours ago
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
4 hours ago
Hope you are doing good.
Did my reply answer your question?
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