How to bypass 'no data found for item-index: n' error?

I’m splitting an array of objects and then accessing their properties in a set node. However, some of those objects lack a property x. I’ve tried using a ternary operator as $(‘Item Lists’).item.json.property ? $(‘Item Lists’).item.json.property : 0 but it stills returns the ‘no data found for item-index: n’ error. Any way to bypass this error within an expression?

Thanks in advance.

Hi @Antonio_Gabriel_Zeni, I am sorry you’re having trouble.

In general, n8n shouldn’t get stuck on a non-existing property. I’ve just tested this using the below workflow on n8n 1.0.5:

The Set node handles the non-existing property on the previous Item Lists node as expected:

Unfortunately you didn’t share an example dataset and workflow to test this first hand. Perhaps you can share a workflow using which your problem can be reproduced so we can help coming up with a solution here?

1 Like

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