Storing previous value of a field and using it in a UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2023 07:08 AM
Is there any other way to store the previous value of a field and then leverage that in a UI action apart from achieving it with creation of a field and using a Business Rule to store it and then using it in a UI Action ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2023 07:17 AM
Hi @Shreyas Khade,
Theoretically you could query the record itself, and use the value from there, since it is not yet updated before the UI Action has completed.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2023 07:20 AM
One can query the sys_history_line table. But I guess Servicenow doesn't recommend it as it could cause performance issues

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2023 07:32 AM
Indeed you could, but If you just need the previous version before saving the record, there won't be a history line yet.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2023 08:16 AM
If you decide to use sys_history_line.
Do not query it directly, but use HistoryWalker | ServiceNow Developers
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.