How does bubble do csv import

Hey Bubblers,
Was laying in bed this morning and pondering csv import.
As I understand bubble or atleast parts of it are built on bubble which lead me to ponder about csv imports and how bubble can import unlimited records and also let you choose how the data is viewed ie number,text,date as well as being able to show an error if there is an error in the csv data (text in a cell when number is selected)
From what I’ve seen in all the run mode functionalities we have to import csv, the data is auto detected
Does anyone know how bubble apecifies how to view a cell and how it detects a cell error?

Here’s a rough list of what happens when you use the CSV importer. (Others are welcome to chime in).

  • It does a check to see if the file type is a CSV. If yes, move on to next step.
  • It checks the total number of rows in the file. (Based on your plan, you are restricted to a certain number of rows).
  • If the number of rows is under the limit, it checks to see if the headers match the fields of the data type you define.
  • For those header fields, it will check to see if the data type of your CSV aligns with the data type in the cell. (Ex. if the field is a number, but you’re trying to upload non-number values into the field, it’ll stop). (Note: at this point, Bubble is scanning through every row for potential errors).

General points:

  • If a cell is empty, that is OK.
  • Every field on the table does not need to be accounted for in the CSV upload. But you should not include fields in your CSV that aren’t on your table in Bubble.
  • Number fields should be plain vanilla (no commas, no currency signs).
  • With the CSV uploader, if you are re-uploading data that you pulled from the database, be sure not to include the built-in Bubble fields (ie. created date, modified date, unique ID). But Unique ID is necessary if you’re using Bubble’s backend for Modifying existing data.
3 Likes

Thanks Dan1,
Does this apply to the backend uploader of which you can choose the data type.
In the frontend Bubble seams to autodetect, however I have trouble when uploading a number into a text

The backend uploader I’ve found to be a bit more friendly. It should autodetect so long as the headers match up. Not sure why number to text would cause issues off hand.

The only thing I’m immediately aware of is that for relational values, you’ll need to specify the field on the table it relates to once Bubble does the initial autodetect. (Unique ID’s are great; but you’ll run into issues if you’re using something like name as a matching field - ex. you have two John Smith’s in your database and user is a thing on the table of data you’re trying to upload).

[quote=“dan1, post:2, topic:30928”]
Number fields should be plain vanilla (no commas, no currency signs).
[/quote]:rofl: Now tell me.

1 Like

Is there any way to have the import exclude entirely blank rows?

Hi - I normally perform an API operation to remove any blank rows (“delete a thing if thing is empty”) after the csv is uploaded. For bulk upload, I don’t think there’s a way to remove prior to uploading

1 Like

Hi Dan, just reading your reply here, and it sounds helpful. I am trying to pull in a database of information from another site for potential users to have as far as their choices. Can you point me to a systematic approach to importing into Bubble? And once pulled in, arranging in a way that is useful. I am new to the platform. So far, so good.

Thanks,
Ken