Getting data from upstream node

Describe the problem/error/question

Summary:

My googlesheet append/update row node seems to only want to accept data from the node that immediately preceeds it.

It won’t accept outputs from a node further updstream in the workflow no matter what settings I try.

Details:

If I place a http request node immediately before the googlesheet node it will accept the output and write it to a googlesheet.

If i move the http request node further upstream where I need it, the googlsheet node will not see or accept its data. Instead it will only accept the node that now preceeds it (in this case a google drive move file node)

I am making very sure the intended input is selected in the left hand side. I have checked and experimented with settings:

  • Append or update row in sheet
  • Parameters tab
  • Values to Send
    • Have tried both Refresh Column List and Remove All Columns
  • I have changed expressions to reference the specific node upstream eg:
    • From {{ $json.orderID }} to {{ $(‘Http Request’).item.json.orderID }}

Scratching my head!!

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.106.3
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: Mac OS
1 Like

Hey @dankini hope all is well.

{{ $('Http Request').item.json.orderID }} does appear to be a valid reference to the value from a node in the beginning of the flow.

When you type if in, what do you see the reference resolving to?

Hi @jabbson thanks for taking the time, regardless of what i try, if i deactivate the “HTTP Request1” immediately preceeding and activate the upstream “HTTP Request” node.

This happens …

This indicates you are working not with the latest version of the sheet.

image

Please click on the circle with arrows to update the fields.

Yes and when i do, it picks up the fields from the immediately preceeding node - Google Drive Move File.

I dont want that, I want it to pick up the fields from upstarem HTTP Request node.

Instead of item use first() or last()
{{ $(‘Http Request’).item.json.orderID }}

{{ $(‘Http Request’).first().json.orderID }}

you need to use this for nodes preceding if/switch/loop/etc.
Note that if there are multiple output it will only get the frist or last etc.

You do want to have up to date columns. The update button is to make sure that the node is synchronized with the sheet it needs to write to.

This is what i want:

This what im getting:

The sheet you have pasted before shows having columns
kind, id, name etc,

what do you mean when you say you want 30x rows of
orderId, customerId, employeeName etc to be writte to that table?

Yes but kind, id, name, mineType etc are outputs of the preceeding Move file node. I don’t want those.

I need the columns orderID, customerID, employeeName, orderPrice, orderStatus outputs of the upstream HTTP Request node.

But as you can see the “Append or update row in sheet” node will not see or accept those outputs from the HTTP Request node.

If however I move the “HTTP Request” Node downstream to immediately preceed the’ “Append or update row in sheet” node, then it will pick up the correct outputs.

How can i maintain the HTTP REquest further upstream where I need it, yet still have the “Append or update row in sheet” node pick up its values.

As stated previously I have alredy tried moving t back upstream and editing all expressions to include node reference specifically. Stil doesnt work though

{{ $('Http Request').item.json.orderID }}

My final output, regardless of the HTTP Request node location, should be like this in googlsheets:

Not

image

OK Ive persevered with no luck so far

Even using a set node which the documentation says “ … is crucial in workflows which expect incoming data from previous nodes, such as when inserting values to Google Sheets or databases’ does not help

Hey, can anyone help me please. I’m having real trouble doing what I thought was going to be a simple learning project.

Use a sample HTTP Request output from the n8n own tutorials

Then have 3 different branches:

  1. Create a new googlesheet from the http request output and place it in a precise location on my googledrive (not root)
  2. Create a new an xlsx file from the http request output and place it in a precise location on my onedrive (not root)
  3. Create a new a new airtable from the http request output (this one worked fine, first time)

Required workflow:

  1. OnForm Submission node (user input to select branch) :white_check_mark:
  2. HTTP request node for data :white_check_mark:
  3. Switch node (to route workflow to correct branch) :white_check_mark:
    1. Create googlesheet and upload to specified location on googledrive :red_question_mark:
    2. Create xlsx and upload to specified loaction on onedrive :red_question_mark:

:red_question_mark: Problems

3.1 The googlesheet apend node wont accept data from my HTTP Request node which is several nodes upstream in the workflow, I have to create one immediately preceeding the append node, and this adds redundancy which doesnt feel right

3.2 Using a Convert file node, I’m going round and round in circles trying to fix the fact that onedrive doesn’t seem to want to accept my binary files and mostly doesn’t seem to recognise the parent ID for the intended parent folder on one drive.

My usecase seems pretty basic but I’m clearly doing something wrong, and most likely not grasping some key concepts.

If someone can help a noob I’d be most grateful.

On the http request —> googlesheet apend issue

After watching something only slightly related on youtube, I decided to add a code node before the googlesheet append node to set column headers.

This results in me being able to consitently map to the fields from upstream http request node as follows:

Now my googlesheet append node looks like this:

Note on a first run through of the workflow the output is empty, right hand side. Also reflected ina googelsheet with column headings but no data:

If I then execute the node again in isolation I get a single row output:

Also reflected in the googelsheet with column headings and one row of data now:

Maybe I need a loop or something? I am not sure.

But in any case I feel like I’m deviating from an optimal workflow.

The ideal would be to simply pick up data from the upstream http request node and I just dont know why it wont do it. Is it a limitation or a bug in the append node maybe? Where would I report such a thing for investigation?

@jabbson you were kind enough to look at this initially, any thoughts?

I think, since the beginning of this topic. our discussion have shifted around a bit, creating a lot of context, which is difficult to keep track of now. If you wouldn’t mind. please create a separate topic for your current setup, define your question and provide your up to date workflow, + screenshot of the execution and I will gladly take a look. Thanks.

Sure, i can do that, though it will be an exact repeat of my first post here, is that what you want? The rest has been me simply trying to troubleshot for myself.

Agree it would be better for me to have posted a separate question re my query about the onedrive branch.

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