Storing previous value of a field and using it in a UI action

Shreyas Khade
Giga Guru

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 ?

7 REPLIES 7

RaghavSh
Kilo Patron

If your table is audited, you can glide the audit history table (sys_history_set) and get the previous value of the field.

Transactional tables like incident are audited OOB in servicenow but tables like sys_user are not.

 


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023

One can query the sys_history_line table. But I guess Servicenow doesn't recommend it as it could cause performance issues

 

Your query should be optimised to 1 record and a particular field. Yes there could be performance issues but this is a exceptional requirement as you dont want to use a extra field or a BR which can fetch previous value.

 

There could be multiple other ways like creating a database view of sys_history_line table and your particular table say incident which will reduce your query time, but again its worth checking.


Raghav
MVP 2023