logo

NJP

How to get previous values using Flow Designer

Import · Dec 15, 2021 · article

Have you ever had the need to retrieve the previous value in the same manner that you do when using the previous object in a Business rule?

There is actually a way to accomplish this.

Since ServiceNow stores most changes in the sys_audit table you can go there to get all previous values if needed.

A fair warning though, the sys_audit table is huge, so don't go down this path if not absolutely necessary.

Now to the solution;Create a Subflow that takes input parameters on which table, field name, record sysid, and created by.

The subflow itself will be simple, it does a look up on the audit table, using supplied input parameters to get the result, and returns the "oldvalue" value.

View original source

https://www.servicenow.com/community/developer-articles/how-to-get-previous-values-using-flow-designer/ta-p/2314670