- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 07:33 AM
I'm working on a flow where a the Record Condition of a Business Application gets set to 'BIA Approval' when a user clicks on a UI Action.
When the Business Application is set to 'BIA Approval', it generates approvals. However, what I'm wanting to do is set the value of the Record Condition field on the Business Application back to it's previous value if the approval is rejected. In the above scenario, it should be set back to Complete when rejected. I've tried using the following code, but it doesn't work:
So I was just wondering if anybody knows what I need to do to set the 'Record Condition' to it's previous value when rejected by approvals.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 11:37 AM
Hi,
If your trigger record is the business application, you should have values populated in the 'changed fields' pill
var changedFields = fd_data.trigger.changed_fields;
var targetField = 'YOUR_FIELD_HERE';
var changedFieldObj = changedFields.find(function(field){
return field.field_name == targetField;
})
if(changedFieldObj && changedFieldObj.hasOwnProperty('previous_value')){
return changedFieldObj.previous_value
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 07:53 AM
you won't get previous value using that syntax using fd_data
1) create a flow variable and store the current value before the update
2) then use it in later stage
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
02-14-2025 01:48 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 11:37 AM
Hi,
If your trigger record is the business application, you should have values populated in the 'changed fields' pill
var changedFields = fd_data.trigger.changed_fields;
var targetField = 'YOUR_FIELD_HERE';
var changedFieldObj = changedFields.find(function(field){
return field.field_name == targetField;
})
if(changedFieldObj && changedFieldObj.hasOwnProperty('previous_value')){
return changedFieldObj.previous_value
}