I’m using the Google Sheets Trigger node in my workflow with Trigger On set to “Row Updated” and Include in Output set to “Both Versions”.
In my workflow, I need to access both the old and the new versions of the updated row.
How can I reference these two versions inside the workflow?
Is there a specific format or structure for accessing them?
To access both the old and new versions of the updated row in n8n when using the Google Sheets Trigger (Row Updated), you can follow these steps:
Solutions:
Use the Data from the Trigger Output:
When you select “Both Versions” in the Include in Output option, n8n will automatically include both the old and new row data in the output. You can reference them in the workflow like this:
Old version:{{$json["old"]}}
New version:{{$json["new"]}}
Check the Data Structure in the Trigger Node Output:
You might want to check how the old and new versions are structured in your workflow output. You can use the Set node or Function node to extract specific fields. Here’s an example of how to reference the new and old rows:
I made sure to select Both Versions in my Google Sheets Trigger — just like in your screenshot — but the output I’m getting is different from what you described in your previous response.
If you look closely, my output shows the entire list of items in the sheet instead of just the old and new values for the updated row.
Could you please provide me with more guidance or a clear example?