TypeError: Cannot read properties of undefined (reading ‘x’)
While similar to TypeError: Cannot read property ‘x’ of undefined, the format of this error implies a different cause.
Sometimes there is information about the location of the error and sometime there is just the error message.
If the error occurs at a random point during a loop then it may be due to a blank cell. Check that the number of conditions in your spreadsheet is correct and debug by setting the loop to sequential.
Alternatively, you might need to define the object.
Another issue can be a lack of a default value if you have if / elif statements to set a value.
Finally, there may be an issue with loading a loop if the selected rows variable is invalid, such as a string of comma separated indices instead of a list.