- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 12:53 AM
I am running a job to check for a state value that is on On Hold and the date given in a particular field matched todays date, then set the state field back to the previous value (i.e. state value which was before On Hold).
Please suggest.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 01:08 AM
Hi,
A simple solution would be to create custom field 'Previous state' on your table and set the value of this field using BR on State change.
A BR would be:
When - Before Insert/Update (condition = state changes)
use below line in script part
current.u_previous_state = previous.state;
This will track the previous state and you can use it in your scheduled job.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 01:02 AM
@Anil Lande - Could you please suggest

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 01:08 AM
Hi,
A simple solution would be to create custom field 'Previous state' on your table and set the value of this field using BR on State change.
A BR would be:
When - Before Insert/Update (condition = state changes)
use below line in script part
current.u_previous_state = previous.state;
This will track the previous state and you can use it in your scheduled job.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 01:16 AM - edited 04-04-2023 01:17 AM
@Anil Lande -- Ok, but we can't make it happen directly by scheduled job or flow designer to fetch the previous value?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 01:24 AM
Hi,
All records in ServiceNow tables store the current value, previous values available in BR only for the specific transaction.
Thanks
Anil Lande