Describe the problem/error/question
For microsoft mssql i need to implement a pagination using OFFSET i FETCH NEXT j ROWS ONLY
After i get the batch of items, i used Split in Batches node (i need them one by one, simplified the original workflow here). After the Split in Batches Done, i tried to update the offset variable in the UpdateOffset node;
heres the expression:
{{ $('IF').item.json.offset + $('Variables').item.json.batch_size }}
it seems that $(‘IF’).item.json.offset doesnt get updated, i put wait node so that i can stop the execution without infinite loop (for testing purposes). also added Code node to console.log the variables
heres my console log:
[Node: "Code"]
Object { offset: 1000, total_customer: 1602, batch_size: 1000, offset_from_if_node: 0 }
[Node: "Code"]
Object { offset: 1000, total_customer: 1602, batch_size: 1000, offset_from_if_node: 0 }
[Node: "Code"]
Object { offset: 1000, total_customer: 1602, batch_size: 1000, offset_from_if_node: 0 }
[Node: "Code"]
Object { offset: 1000, total_customer: 1602, batch_size: 1000, offset_from_if_node: 0 }
hopefully its clear, i need to update the offset variable after the Split In Batches node (Done flow), so that i can select the next batch of items and process them.
What is the error message (if any)?
no error message
Please share your workflow
Share the output returned by the last node
Information on your n8n setup
- n8n version: 1.8.2
- Database (default: SQLite): postgresql
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): npm
- Operating system: MAC OS Ventura 13.5.2