CSV File to JSON

Remove the button tag with the import function from the script (Line 1).

Create a button/element or whatever you want to trigger the flatfile wizard in bubble and add a action of “Run Javascript” (assuming you installed the plugin) and past the code from Line 33 to Line 38 from the first image your shared.

importer.requestDataFromUser().then(function(results) {
console.log(results.data)
// do something with the clean data here like upload it to your server
}, function() {
// do something if the user closes the importer
})

You should be able to see the results in your console log (chrome browser).

What would like to do with the data? you can use the Javascript to Bubble tool to take that data and send it via API to your bubble endpoint or you can make the API call right from the script using Javascript…

If you run into a issue, you can share the editor with me and I can help out.

2 Likes