When importing a csv file, if a column is missing from the imported file (e.g., the user accidentally deletes a column while editing in Excel, and then imports), the importer works without issue; for each row, it uses the values in the file for all other columns, and the missing column gets the default value for that column. If the user is replacing the existing data in the table, this could lead to a lot of accidental data loss.
Is there any way to prevent the import from working if the file is missing columns from the table?
Currently it’s not supported and we’ll be reviewing this case.
One solution is to check the columns count at the time of import using callback function, but it’ll show the validation message on 3rd step before the insertion in database. If you want to test this import callback validation, please email me at [email protected] and I’ll send you related demo files.
Abu Ghufran - Dev Team
Grid 4 PHP Framework
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?