Is there a way to allow members to add to DB via a file?

Members of my site will have to upload their customers to the Data Base. We are talking about 100 to 200 items, and about 10 fields per item. Uploading this amount of data via a form is not a reasonable option.
On the other hand, all this data already exists on an excel file somewhere on their computer. Surely there must be a way of allowing my members to upload a file and populating the DB with it dynamically? Hours of searching the web and I’ve drawn a blank.

Thanks for the help.

You can let the user upload a csv file and then either use a node package to parse it, or read the file using wix-fetch(fileUrl) and parse it to an array of objects form (I think I posted an answer with example here a while ago, but I can’t find it now. try to search the forum).
If it’s a Google spreadsheet, there’s an NPM for that as well.

Thanks @J.D.
You’ve given me a lead to follow. I’ve got some learning to do now. Much appreciated.
If you do manage to find you’re previous post please let me know. I’ve never used it before so an example will be helpful.

Also, I seem to recall that WIX supports xls and some others but not csv. I must be wrong I guess.

@allon-schamroth See here:

@jonatandor35 Thanks so much J.D.
That great. I will get started on that and hopefully will manage.
How do I find out the url of uploaded files. Where did you get



@allon-schamroth do a test, upload a csv file to the media manager, open the file, see its subdomain and domain and use it. I think (but am not sure) its the same for all users. Try to use “” first

By the way, you may need to run some more actions: to get rid of some unwanted “\r” or to change the type from string to number and date etc… but all can be easily done with JavaScript.

Yeah thanks. That’s no problem.
You saved me a ton of hours and lost hair.
Thanks again

@jonatandor35 FYI, after looking into it… it seems that the first part of the url is the ID of the site owner/admin.

1 Like