I have a simple workflow that is almost working, there’s just one part I can’t seem to get working.
My flow is as simple as:
[Google Sheets Trigger] → [Send Email]
It connects fine, it lists all of the data in the sheet I select, everything…perfect. I select the option “Include in Output: Both versions” as I would like the old value and new value.
In the SMTP node, in the text of the email, how am I supposed to get the Old and New variables of the record/cell that has changed?
If I do this:
Item has been changed on Sheet 2:
{{ $json.FirstName }}
{{ $json.LastName }}
I get an email that simply contains:
Item has been changed on Sheet 2:
And nothing more.
There are 2 records in this sheet but only 1 field has been changed, so I would like it to say something like:
Item has been changed on Sheet 2:
LastName: Was ‘poppins’
LastName: Now ‘blobbins’
How can I achieve this? I presume it’s currently blank because I’m not specifying which version I would like data for but how do I get the values?
If I change the option to just “New Values” (or “Old Values”) then it works fine but obviously only gives me the value it has been changed to and not what it was previously. I’d imagine there’s something like {{ $json.FirstName.oldValue }} and {{ $json.FirstName.newValue }} to actually get what I need but I can’t find it.
Just to confirm; this is when the task runs automatically, I am not trying to get the old/new values from within the editor as I know it doesn’t work in that scenario. It is when it is saved and active and naturally runs.
Thank you for any help/assistance with this!