Cannot read properties of undefined (reading length)

Hello :slight_smile: I am receiving this error while working on my application. The action compares and iterates through objects. Anything wrong on my part or is this a bug of some kind? It randomly appears when i run the action.

Skjermbilde 2024-02-15 154234

Skjermbilde 2024-02-15 154056

1 Like


This is due to a function similar to this one (where the number of characters from a string is returned):
return mystringvariable.length

If mystringvariable is undefined, you get this error. So it is a missing safeguard in your setup, and you should have the function like this:
if (mystringvariable) return mystringvariable.length

I cannot see from the screenshots where this function is defined. But if you hide the whole UI when the action executes (or try to execute the action from an empty view), then you can conclude that the function is not in the UI - meaning the function is either in the action (e.g. an update object with such a function in it) or as part of a runtime property on a data source that is affected by read/update/create action nodes in the action.