Prebuilt Import Action from Excel | TypeError: Cannot read properties of null
I use to Import the Member List using Prebuilt Import Action. I don't see mistake. Can anyone help me to find the error that I forget to implements?
Here is my error:
10 Replies
do you have something like in your code? if $member is null, then you can't retrieve its phone
No, I don't have something like this. I follow this filament instruction to import data from CSV file.
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import#using-import-options
Does your CSV contain phone? you have set it as required.
Yes, I check it multiple times.
Can you provide the importer code
Ofcourse, here it is...
have you declared the model in the class?
Ahhh I suspect it is
phone will be null here I suspect since new Member() will have all empty fillables I suspect
I don't understand, what are you talking about?
Nevermind I was being dumb, but phone is being null somewhre
Not only phone. After uploading the CSV file, all data shows null. Only header can be read.
I'm not understanding, how can I dump the data from uploaded CSV file. Because the error coming from file uploaded. If the header of csv file can be read, why the data is empty?
I know that, somewhere I do mistake. That's why the phone showing null. I have to find the error and I don't know how to do this.