Describe the problem/error/question
Hello!
I have a main workflow which uses 2 workflows, one workflow update a google sheets and the other one Notion, the data is updated with a Shopify Trigger.
However on of them are getting the error described at the subject.
I reported another case previously here.
I made the adjustments suggested but now I am experience the same error.
Which is intriguing, is I have no problems with Google Sheets (first workflow), the problem is the second one (Notion).
the error is reported in this line:
Payment_Method: inputData.payment_gateway_names? ‘’ : inputData.payment_gateway_names[0],
Which I understand I am doing here is validate the field payment_gateway_names is not “UNDEFINED”. But look like it doesn’t work.
I shared the execution error message.
In the flow I shared I changed the code to:
Payment_Method: (inputData.payment_gateway_names?.length || 0)===0? ‘’ : inputData.payment_gateway_names[0],
I hope this new validation works.
I really don’t understand why n8n found the field as “UNDEFINED” since the value exists and is correct.
This is the current data fetched from Shopify:
“payment_gateway_names”: [
“paypal”
],
What is the error message (if any)?
Cannot read properties of undefined (reading ‘0’) [line 136, for item 0]
Please share your workflow
https://drive.google.com/drive/folders/1UNrNslzEOsvHeDxosvqjmgTb4jrc37Ve?usp=sharing
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- **n8n version: 1.39.1
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- **Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
- Operating system: Windows 11