What is wrong with this Set node?

Describe the problem/error/question

I have added a Set node to add two values to a variable that is created at the start of the workflow.

What is the error message (if any)?

ERROR: Can’t get data for expression under ‘Values to Set > Number’ field

Please share your workflow

Share the output returned by the last node

Previous Postgre node is running an SQL query. Here is its output
[ { "success": true } ]

Missing pairedItem data (node ‘Postgres1’ probably didn’t supply it)
Item Index: 0 | In or underneath Parameter: Values to Set > Number

"name": "MyOffset",
"value": "={{ $('Set MyOffset to 0 and MyLimit to 10').item.json.MyOffset + $('Set MyOffset to 0 and MyLimit to 10').item.json.MyLimit }}"

Information on your n8n setup

  • n8n version: 1.7.1

Hey @YogiYang,

It looks like the issue is because of the Postgres query and the node is not setting the paired items correctly.

Are you using the execute query option in the node or one of the others?

1 Like

Yes I am using this just before this Set node.

Here is the screenshot of my modified version of workflow.

Hey @YogiYang,

Perfect so it looks like this will be related to Paired Items and we seem to be aware of this one already and will likely fix it in the future but you may need to reorder your workflow for now for things to work.

Out of interest what is the query your Postgres node is running?

Insert query.

Hey @YogiYang,

What is the full query?

The query is

insert into logger (status_code, count_num_of_rows, last_offset) values(200, {{ $('Set_Main').item.json.MyLimit }}, {{ $('Set_Main').item.json.MyOffset + $('Set_Main').item.json.MyLimit }});

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.