Google Sheets - Invalid expression under ‘Columns’

Hi there!

I have, unfortunately, another error in my workflow. I want to update my Google sheets only when there aren’t matching in email field.

If I don’t use an IF statement and a check in the field sheets, the workflow works, but with these it doesn’t!

The error is this: ERROR: Invalid expression under ‘Columns’

The expression uses data in the node ‘IF: Email existing’ but there is more than one matching item in that node

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:1.0.5

Can you help me with this problem? @Jon @giulioandreini

Hey @LucaDipa,

Looking at the node one of the expressions doesn’t use item.json so it could be that, I would maybe delete each one until you find the expression that is causing the issue.

Hey @Jon, thanks for your reply.

Maybe this is because i have an array of value?

The value of array that I have:

image

Because if I setting the value in this manner it works:

{{ $(‘IF: Email existing’).first().json.contactDetails.emails }}

but it only gets me the first object and I want to import them all…

I Think there is an error in “IF: Email existing” node, but i don’t know which

Hey @LucaDipa,

If it is an array that would do it but we don’t have the data you are using so it is hard to say.

Hey @Jon

I’m sorry, but unfortunately I can’t provide all the data for privacy!

However I think the problem lies in the fact that not all items in the objects “Contact Details” array have the value “emails”. Could this make it go wrong?

This is the error when i want to configure the “IF: One/more emails” node:

ERROR: Can’t get data for expression under ‘Conditions > String’ field
In node ‘undefined’, output item 2 points to an input item on node ‘IF: One email/More emails’ that doesn’t exist.

How I can pass only the objects that have emails?

Hey @LucaDipa,

You would need to use an if node to check for items or maybe use something like {{ $json.value || "Not Set" }} and see if that works.

Hi @Jon

Unfortunately I haven’t solved the problem yet… I leave here an example dataset (have 10 items the original) which is the input of the first node (an http request) and all other nodes. If instead of checking the address in the database, I connect the “Filter” node directly with “Import data” it works, otherwise it gives me the error:

ERROR: Invalid expression under ‘Columns’
The expression uses data in the node ‘Filter’ but there is more than one matching item in that node

But I need to check the db for duplicates

I’m sorry for the trouble! :pray:

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