Is possible to import json data with Wix code from a file ?

I need to upload a collection with more 1000 records, 'cause periodically some records change.
I would ask, is possible achieve the goal by wix coding ? I imagine a button and a field where you can choose a file.

thanks in advance
Mauro

As far as I know, Wix does not allow you to upload files. So you have 2 options:

  1. write a backend function that does all the logic using 2 dummy records in JSON format inside your code. Once this works, copy and paste (by hand) the real JSON data into the place of the dummy rrecords. Maybe you will have to do this in chuncks
  2. on the server with the JSON-data, write a program that accepts HTTP-get calls, using a parameter like

https://myserver/myjsonapp?startrow=0 (and then 24, etc)

this program should query the db for n records starting from the startrow-param, wrap them into JSON-format and rhen hand it over to Wix, where you would wix-fetch with GET to … get to this endpoint. Just make sure you do it in chunks (like 25 or 50 at a time), or you will run up against the well-known 14 second time-out.

Hope this helps.

thanks Giri, you confirm that unfortunately Six Code is unable to manage file and that’s big limitation.

Hi @giri-zano today I were re-reading your suggestions, especially that about the 14-seconds:
«Just make sure you do it in chunks (like 25 or 50 at a time), or you will run up against the well-known 14 second time-out »
I’m struggling with a problem of WebModule timeout 14 seconds ma nobody of the moderators answers to my post. This Forum is really not able to follow all the posts.
But perhaps you show me the way. Thx