1T - CSV Creator 3.0

CSV Creator 3.2.0

(updated Jan 31, 2021)

TL:DR - Have added a new page element that exposes the generated file to be saved directly to the database. Can turn off the option for the user to download the file directly to their device.

All previous functionality still exists. New functionality below:

Send JSON to CSV Creator
This action is only available when using the page element CSV Creator and will return a file which you can then save to your database, email to the user, etc.

The file can be accessed on the CSV Creator page element state called ‘created File’.

This action also exposes an event called ‘A CSV Creator has created your file’ which will be triggered anytime a CSV is generated. Use this event to simplify performing additional actions with the generated file. Since this event is only triggered when the file is complete you won’t have to worry about making sure the new file is ready before running additional actions.

Can also uncheck the option to allow the user to download the file directly to their device.

cc: @j.henriiquue

6 Likes

Hi @eli

Just played around with the plugin and very excited about utilizing it. Thanks for putting it out there.

I did run into one issue that I believe stemmed from my CSV file having an empty row.

There were only 7 rows filled with data but 8 rows in the CSV file in this format (note: my device doesn’t have excel installed)

Screen Shot 2021-02-02 at 2.10.54 PM Screen Shot 2021-02-02 at 2.10.49 PM

When I first tried to run the upload I got an error in my logs

At first because of the row number 8 and the unique id portion I thought it might have something to do with the custom headers, but that wasn’t. I then checked my csv file and saw there was a blank row. After deleting it the csv file upload went smoothly and the custom headers were accurately added to the DB as well.

Before testing the plugin I uploaded the same CSV file through the database upload feature in the editor and there were no issues.

I believe there may be a way that the Bubble editor upload feature ignores blank rows.

I’m curious if this has been an issue, as I could imagine at times a user may unwittingly have some blank rows, or even columns.

Cheers

Matt

Hey @boston85719,

Which element/action are you using for this?

I find this plugin extremely useful. However, whenever one queries a large dataset you either have to do “full list” RG or risk the download timeout. Even with a “full list” RG there are severe limitations in that even this can and will timeout eventually. It would be nice if there is a way to keep sucking data until the full set is retrieved and then generate the csv.

I followed your example from the video

Screen Shot 2021-02-03 at 12.04.10 AM

Then set up the same backend workflows you had set up from the video demo


Once I deleted the empty row from the CSV file in the format I have on my computer (which I think is just app text) the issue went away and everything upload perfectly including the custom headers.

I Believe I may have posted this on the wrong showcase

However, another issue I am experiencing I believe is about the CSV creator plugin.

I get this error message

Screen Shot 2021-02-03 at 12.14.44 AM

Based on this workflow action

Using data from this data type

Does anything jump out to you about what I am doing wrong for this?

Aha! I was wondering :slight_smile: Haven’t created the showcase for Uploader yet as it’s still quite new. Will take a look at this issue. Should be able to strip out any empty lines to avoid this. Thanks for pointing it out! Will get back to you as soon as it’s resolved.

On the CSV creator issue, you need to have a single search and then use the ‘:format as text’ operator and put your JSON in there. So that field should look like ‘Search for Netflix:format as text’

Will be doing a demo video for this soon as well.

1 Like

@boston85719 Here’s a walkthrough on setting up the CSV Creator action:

13 Likes

Great stuff!

Eli Thanks for this video. Got it working and excited to utilize it

Cheers

1 Like

Hey @boston85719,

Just pushed an update to the Uploader plugin that removes empty lines from the uploaded CSV which should resolve this issue. Cheers!

That is awesome. I’ll try to play around with it in the next few days. Thanks for updating me on that.

This plugin is amazing and has saved me so much time, thank you!

I’ve run into an issue which I think is related to file encoding and Excel. I have a list of cities with European characters in, eg: “GJØVIK”. When I open the exported file in Excel, it displays as GJØVIK. If I open the file in Notepad it shows the exported file’s encoding as UTF-8. If I re-save the file with ANSI encoding, it displays fine in Excel.

Is there a way to control the file encoding in Bubble?

I’ve forked your code and made a change on line 12 of Create CSV from JSON

csvFile = "\uFEFF" + Papa.unparse(content,{delimiter: delimiter});

This fixes the issue on Windows and Excel. There are a lot of examples of the issue out there, but this is a pretty quick summary.

Hey @daniel.whiting,

Sorry for the delayed response! I’ve not been on the forum this week but thanks for sharing both the issue you were having and the solution. Truly making this a community plugin :slight_smile: I’ll add this as an optional selection to the main plugin.

Have you had experienced any issues at this point or does it seem to be working properly?

1 Like

@eli would it be a substantial lift to make this plugin work server side? Is it doable at all?

2 Likes

@lucien, this is a popular request recently. Processing the data is not an issue but creating and returning the actual file has proven a bit more difficult.

2 Likes

Hi there. Is there any limit on how many things/rows can be exported thru this plugin?

Or can I retrieve 100k things thru this?

Have you found a fix for large data sets?

I could pull more data by creating a link to another table and referencing it instead of a search for in each field but I believe the limitation still exist.

Hi @eli

No issues so far, it works perfectly well with the FEFF character in there, and hundreds of records. It could cause a problem if you’re parsing the CSV output with another tool that doesn’t know how to handle UTF-8 with BOM, eg, but the same can happen if you just create a CSV file in Excel.

I have found a separate issue where JSON.parse throws an error if the data contains a horizontal tab character - ascii 09. You might want to filter that character out as well.

Cheers

1 Like