How to show both old and new data that is updated via a Workflow PDF template

I know I’ve seen info on this at some point in the community or in Office Hours, but I can’t seem to find it again…

I have a Workflow that generates a PDF template and then emails it it to key departments when certain information is updated. It’s easy enough to get the updated data on the template by simply putting the column name on there but I would also like to show the old data that was updated in the template so people can see the old vs. the new info. What expression would I use in the template to show what the data was before it was updated?

Simple example:
Customer phone number, [Phone], is updated. I need the PDF to show both the old phone number and the new phone number when that data is changed.

Any help is greatly appreciated. Thanks!

Hi, you can show them either with [_THISROW_BEFORE].[Phone] or [_THISROW_AFTER].[Phone]

1 Like

Aleksi are you sure this will work on workflow expression ?

Yes, it will work.

1 Like

Great, I will use the trick on the next opportunity.

This is bit too technical side of question. It is understandable [_thisrow_after] value is retained, as it is just “current” value in the field. But how long and just how does Appsheet “retain” the [_thisrow_before] value?

When we refresh the session, the _before value would gone? I assume it is stored in Client side somewhere, cache, browser storage etc?

This format [_THISROW_BEFORE] only works with the workflow when you create a pdf right after a data change. It doesn’t work as a normal expression like an app formula. If you change something else than [Phone] field, the [_THISROW_BEFORE].[Phone] and [_THISROW_AFTER].[Phone] are the same.

1 Like

I can confirm that it works! THANKS!!


You’re welcome

For reference:

1 Like