Getting "Cannot read properties of undefined (reading 'length')" when trying to create new lead on ERPNext

Hi, newbie to n8n here. I’m just testing out to see if I can automate reading GSheets and creating new lead documents in ERPNext. The sheet is just one single row containing the data to create a new lead document.

Problem comes in when trying to create the document where I get the error “Cannot read properties of undefined (reading ‘length’)”.

Do I need to define the number of rows as length or is it some other problem?

Below is my workflow.

Information on n8n setup

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

Welcome to the community @Hilmi_A !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.

Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!


I think you can get by without Code node and you need to map the values between GSheet data and ERP by adding the Properties in the latter.

1 Like

Turns out I was overthinking things and that’s really all I needed to do. Thanks for answering!

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