Error when calling "getCredentials" with expressions in credentials form fields

Describe the problem/error/question

Some parameters of my custom node are of type “options” and I use a http request to fetch the options shown in the UI. In order to make the http request I need to get node’s credentials.
In the custom node credential form, I’m using an expression to get data from previous node and populate the form as the picture bellow:

However I get an error when using the custom node’s helper method this.getCredentials(…).

ExpressionError: No data found for item-index: "0"

The error doesn’t occurs when I fill the credentials form with fixed data rather than expressions.

The workflow is simple like that:

Any ideias why this error occurs?

n8n setup

  • n8n version: 1.1.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Debian OS 11

Hey @Marco_Chaurais,

Welcome to the community :raised_hands:

I believe expressions are actually only used by credentials in workflows when they are executed so in your case while the front end is showing the value from the previously run node the backend is not aware of that.

1 Like

That makes a lot of sense.

Thank you for reply @Jon.

1 Like

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