Question regarding CSV import of user data

I just completed the “Import user accounts from CSV” task in Missions.
Login validated after importing using the Users.csv file, so I got credit for completing it - but I still have questions.

Before I realized I was supposed to use that specific CSV file, I prepared one of my own and tried using it. I named it user_import_test.csv and it had the columns: ID, Email, Name, Password.
This file was imported into the Backendless app’s APP TABLES section, and from the REST CONSOLE I was unable to log in using the user credentials contained within the file.


↑ After importing user_import_test.csv, “user_import_test” appeared under APP TABLES. These users could not be logged in.

However, when I used the file provided by Backendless (Users.csv), I was able to log in with those user credentials. And the data from this CSV file appeared in SYSTEM DATA (instead of APP TABLES). I don’t know why.

user-import-users-system-data
↑ After importing Users.csv, “Users” appeared under SYSTEM DATA. These users could be logged in.

I feel like I don’t understand how this process works, and why it didn’t work with my own CSV file.


One final weird detail: After deleting the imported table data from my user_import_test.csv, and re-importing an updated version, the newly added data did not appear.
What I added in my new version of the file was a column blUserLocale, with all users given a locale value of en.

I tried this because of a comment from user evcaliptus1 stating “The problem occurs because the file does not have the required column blUserLocale.”
Well, I added this column - but it didn’t even appear for me when viewing the SCHEMA.

I wonder if it is related to some “constraints” specified in the column names of Users.csv. For example, the column for email is not titled simply email, but instead:
email({"constraints":["NN","UQ","IDX","IDN"],"type":"STRING","dataSize":36,"dataSizeAuto":false})

Maybe there is some expected syntax validation that my CSV file doesn’t include specification for?

Hello @Causality

The file name is the name of the table where the data will be imported. That is why you have created the table user_import_test.
Login is possible only for users whose data will be in the system Users table.

blUserLocale is a system table name and it cannot be used in non-system tables and cannot be created by you, that’s the reason why you didn’t get the data when importing again.

You can always look at the logs in the file system ( import folder).

Regards,
Inna

1 Like

Thank you for the reply.

Would it be correct to say that “Users” is a reserved name?
So any time a file named Users.csv is uploaded, its contents will either be appended to the existing Users table or will overwrite the existing Users table?
(Depending on whether the checkbox is ticked or not?)

I don’t know how to view the logs.
Maybe that is explained in a Missions task I haven’t reached yet.

Yes, you understood correctly. But only those records that have a common objectId will be overwritten.
To view the logs, you need to go to Files >> import and open the log file.

Regards,
Inna

1 Like

Thank you!

I see that there are .log files, and also a separate Users.csv file.

And I can see that in the log file the column blUserLocale was mentioned:

02:02:36 IMPORT_DATA Cannot complete insert batch (1) for table 'user_import_test'. Unknown column 'blUserLocale' in 'field list'

Maybe it will only import a column’s data if the column is already defined in the SCHEMA.

It’s starting to make more sense, piece by piece.

blUserLocale is the system name for the column. This will always return an error for a non-system table.
If you see a csv file in the import folder, most likely the import is still in process.

Regards,
Inna

1 Like