#Error: can't access property "findIndex", e[r].rows is undefined

11 messages · Page 1 of 1 (latest)

median berry
#

i have this field in which i enter csv and it converts and stores it as fields called rows and columns. this funcitonallify works fine the problem is when i save the record i get this Error: can't access property "findIndex", e[r].rows is undefined. tried agents to debug this. it couldt resolve the issue . here is the code and the full error thrown

graceful jacinthBOT
austere hearth
#

Hey @median berry

When does this error get thrown? Does the data you saved to the fields persist?

#

I know it happens on save, but at what point? Before data gets saved or after?

median berry
#

i dont know really know when i reload the site the data seem to be saved

#

presuming it is after getting saved

#

the intended functionality is working but i get this error in the admin panel

austere hearth
#

Seems to me like there is some mismatch between the nested array field you have and your helper function tbh

median berry
#

and this is the first time i am using payload cms and i used a lot of ai to make things work

austere hearth
#

Is a field-level hook really the best place for this? I would try doing this work in a collection beforeChange instead of the field

#

Seeing as how you want to change sibling data as well