How to use Values in other Nodes

Guys,
I started using N8N and I’m having a problem that I want an idea of how to solve.
I have a select that returns data from some companies that I need to post in an SFTP.
It turns out that I have the location of the director in the BuscaEmpresaReviewPro node, how can I use this field value in the FTP?
Basically it is using a value from a Node that is not directly before it.

my workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:1.18.0
  • Database (default: SQLite): Postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu

Welcome to th community @Douglas_Specht !

If you open the node where you want to use the value of the previous node on, you are able to select the node of which you want to use the value via the selector on the top left side (only if the node got executed before).
You will then see all th available values, and you are able to drag and drop any of the values on the parameter you want to use it on.

Thanks for your response, I’m very excited to be using n8n.

I had already made this option, but this error occurs:

ERROR: Can’t get data for expression under ‘Options’ field
In node ‘GetCheckin’, output item 0 points to an input item on node ‘Loop Over Items‘ that doesn’t exist.

I tried to get the value from the loop, but the error also occurs

Very strange. Can you please share what it says if you expand “Details”.

Thanks again, here is the error:

OUTPUT

1 item

07/12/2023, 08:37:09

Item Index: 0 | In or underneath Parameter: Options

Cause
Data below may contain sensitive information. Proceed with caution when sharing.

{

“fileName”: “={{ $(‘Loop Over Items’).item.json.DIRETORIO_IN }}”,

“headerRow”: true

}

Stack

ExpressionError: Can’t get data for expression
    at createExpressionError (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:465:20)
    at getPairedItem (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:635:23)
    at pairedItemMethod (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:734:40)
    at Object.get (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/WorkflowDataProxy.js:737:40)
    at Proxy.eval (eval at getFunction (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/index.js:24:22), <anonymous>:6:62)
    at Tournament.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/tournament/dist/index.js:33:19)
    at evaluateExpression (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/ExpressionEvaluatorProxy.js:110:16)
    at Expression.renderExpression (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:217:70)
    at Expression.resolveSimpleParameterValue (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:195:34)
    at resolveParameterValue (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:276:25)
    at Expression.getParameterValue (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Expression.js:293:31)
    at getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1421:42)
    at Object.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2049:24)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/SpreadsheetFile/v2/SpreadsheetFileV2.node.js:168:38)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:672:42)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:652:68

hello @jan
Would you have any suggestions on how to fix this error?

Seems like a bug.

A temporary workaround, considering that the node only outputs one single item, would be to use the expression:

={{ $("BuscaEmpresa ReviewPro").first().json.DIRETORIO_IN }}

Ah actually ignore that. I saw that wrong in a screenshot above. If it would have only one item the whole Loop Node would not make any sense.
In this case, if you have set the Batch-Size to 1 you could probably do:

={{ $("BuscaEmpresa ReviewPro").all()[$runIndex].json.DIRETORIO_IN }}

It doesn’t seem to work, see the error:

Ah yes, that is expected. Realized that myself after I thought about it a minute. For that reason did I post another suggestion just a few minutes after that.

it worked for me this way.
but it would be interesting, it worked just by selecting the node, where you commented that it would be a BUG

thanks

Happy to hear that it works.

Sadly, I do not understand what you mean with “it worked just by selecting the node, where you commented that it would be a BUG”

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