Forum

Jennifer Häfner
Moderator
    Has successfully completed the online course Intermediate (200)
    Has successfully completed the online course Advanced (300)
    Has successfully completed the online course Basics (100)
    Has successfully completed the online course Advanced (310)
    Has successfully completed the online course Advanced (320)
    Has successfully completed the Intermediate Certification
    Has successfully completed the Advanced Certification
3 years, 11 months ago #29995
Up
2
Down
::

Hello Dimitri,

your use case seems to be structured into 3 parts:
1) uploading a csv file
2) parsing the csv file
3) getting the data into the SQLite database

So for the respective steps:

1) You need to implement the upload process. On our marketplace, we have an example app where the upload process is implemented. Here is the article that describes it, you can also find the download link for the application there: https://community.simplifier.io/knowledge/drawing-on-images-with-the-signaturepad-widget/
The example app deals with the Signature Pad widget, but you can use the upload process from there. In the Business Object function ‘upload file'(described in Step 3), change the code line temporaryFileReader.readAsDataURL(oFile);
to temporaryFileReader.readAsText(oFile);

2) Parsing the csv file: after uploading the file, you can parse it from CSV to JSON using the javascript library ‘PapaParse’ (https://www.papaparse.com/). Upload this library to your Simplifier instance (here is the documentation on how to do this: https://community.simplifier.io/doc/current-release/extend/including-libraries/add-new-library/). Also add this library to your Business Object to be able to use its functions there.
Create a business object function that takes the result from the fileReader and parses it to JSON (with PapaParse).

3) Now you have the data from the csv in JSON format. This data can be used in a connector to be written into the SQLite database (it depends on your use case which data you want to write).

I hope these tips are useful.