"TypeError: Cannot read property '0' of undefined"

output: object

predictions: array[1]

0: object

fields: array[1]

0: "prediction"

values: array[1]

0: array[1]

0: 67

error: :"TypeError: Cannot read property '0' of undefined"

code in function:msg.payload=msg.payload.predictions[0].values[0][0];
return msg;

where it went wrong?

Have a look at this - https://nodered.org/docs/user-guide/messages
to see how to find the correct path to the data you want.

Also see this post on how to share code and debug so that it is easier to read and import - How to share code or flow json

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