CSV / JSON / IMPORT / EXPORT and more...

Hello,
i am experementing with imports and exports of DATA from & into a Wix-DATABASE (Data-Collection).

I could reproduce the following example…


And i also was able to convert CSV-DATA —> to —> JSON, with this online-converter-tool…
http://www.convertcsv.com/csv-to-json.htm
(using the first converter-option —> “CSV” to —> “JSON”)


The converted JSON-file looks like…

[
 {
   "Index": 1,
   "Vorname": "Barack",
   "Nachname": "Obama",
   "Alter": 33
 },
 {
   "Index": 2,
   "Vorname": "Donald",
   "Nachname": "Trump",
   "Alter": 44
 },
 {
   "Index": 3,
   "Vorname": "Angela",
   "Nachname": "Merkel",
   "Alter": 55
 },
 {
   "Index": 4,
   "Vorname": "Vladimir",
   "Nachname": "Putin",
   "Alter": 66
 },
 {
   "Index": 5,
   "Vorname": "Kim",
   "Nachname": "Yong",
   "Alter": 77
 }
]

On my example-page…
https://www.media-junkie.com/xlsx-site-test

…after inputing the JSON-STRING into the TEXTBOX and choosing the right COLLECTION,


all the DATA was written into my empty “Test-Collection” DATABASE in LIVE-MODE (on LIVE-SITE).


Everything worked pretty well. But the FIELD-IDs are not complete as you can see…,

…and the connected DATASET+TABLE do not show the inserted DATA at all.


Question: How can i define the FIELD-TITLES (FIELD-IDs) the right way (using code and not doing it manualy in my Wix-Content-Manager), so that the DATASET also recognize the DATA of the connected Collection.

How i can get rid of the yellow marks (exclamation marks)?

Anybody any idea? So my plan is not possible right?
I have to set the FIELDS manually in the Data-Collection (Preview-Mode), right?

Ok, no answer = no way to realize this. :expressionless::persevere::disappointed_relieved:

Found something interessting…


Like i already assumed —> fields are not defined.

My question is still the same: Is there a way to define them (using CODE) and not doing it manualy in the Content-Manager (Sandbox).

Hi!

Currently, there is no way to create new collections or define new fields on existing collections using code. This can only be done statically in Content Manager when opened from the Editor.

Thanks! Now it`s clear.

Ok, since i know that you can’t define FIELD-IDs by “Velo-code”, now i am working on how to import CSV-files by CODE into my “DATA-COLLECTION”.

I found some posts which differs a lot of the used method.

  1. upload-file + fetch
  2. using nmp-extensions
  3. using HTML-Component
    and some other suggestions…

I found this 2-posts…
1)
https://www.wix.com/velo/forum/community-discussion/how-to-import-database-through-site

https://www.wix.com/velo/forum/community-discussion/let-members-upload-csv-files

I tried to upload a CSV-File (using the following example), which i found in the post (1).

but i recognized that this do not work…

So my question is, what exactly was uploaded in the example (post-1) ?

Perhaps J.D. can clarify this???

My aim is to import a CSV-FILE using a BUTTON or UPLOAD-BUTTON + CODE and not doing it manualy via Content-Manager .

Where the hell is J.D. ? :grin:
Still waiting for some answers.
Which file was uploaded in the example? Was it a CSV-file?

following

I believe it is no one (or only you) need this…

Hey Wing - you and Russian Dima are always trying to do crazy stuff. Challenges are fun.

:face_with_hand_over_mouth:The next thing maybe build a Wix website builder on wix​:rofl:

@certified-code :sweat_smile::wink: the time will come :laughing:
Ok, i understood. My plan will not work, as i can see. DAMN ! :persevere::laughing::sweat_smile:

Anyway, now i am on my way to understand NPM, perhaps some new doors will open, who knows :stuck_out_tongue_winking_eye:.

Sorry, just a notice for me and myself :grin:
https://www.wix.com/velo/forum/community-discussion/is-there-a-way-to-allow-members-to-add-to-db-via-a-file