Extract Specific data from Array

Hi there,

I'm try to extract a specific data from a field, but I'm getting the following error. I would greatly appreciate if someone could help me out .

Thank you in advance.

Kind Regards

Expand the array in debug window. Perhaps element [1] is undefined.

You should probably check an object is not undefined before accessing a property of it.

Forget that. Just realized your first iteration in the loop overwrites msg.payload.

You are literally destroying the payload object on the first loop.

Is this is a duplicate topic ? from Extract Data from Many Array

1 Like

In fact looking again, why would you loop through an array and copy a fields value to the same payload property 28 times anyway?

Additionally, is there always 28 items? Surely you would only want to loop the loop while < msg.payloads.feeds.length

Looks like it.

Naughty OP :wink: