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

Peter Bodelier
Giga Sage

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.

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

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.

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.