I’m having an issue with the Google Sheets node (Get Rows) in the Sheet field.
I tried passing dynamic data as an array, and the expression preview correctly shows multiple values.
For example:
[
{
"sheet": "Hello"
},
{
"sheet": "World"
}
]
When I use this value in the Sheet field, the expression preview displays both sheet names correctly.
However, when the workflow runs, the node only works with the first sheet (hello).
It does not iterate through all sheet names as I expected, like a loop.
Is this expected behavior, or am I missing something?
You need to transform your single item containing an array into multiple separate items.
Insert an “Item Lists” Node: Place an Item Lists node immediately before your Google Sheets node.
Choose the Operation: Select the “Split Out” operation.
Specify the Field: In the “Field” parameter, enter the name of the field that contains your array (e.g., if your data is in a field called sheets, enter sheets).
Connect to Google Sheets: Now, connect the Item Lists node to the Google Sheets node.
@VDws the node runs once per incoming item, not once per array element in an expression. so the expression preview lies a bit, it only ever picks $json from item 1. drop a Code node before it that returns one item per sheet, then reference {{ $json.sheet }} in the Sheet field.