Baserow imports number fields as text fields

I’m trying to create a new table by importing, either from .CSV or from Airtable, but Baserow imports my number fields as text fields every time. The table has over 300 number fields, so it’s not practical for me to manually change them all after import. Besides, the documentation says that Baserow will recognize number fields as numbers, but it’s not working that way for me. Anyone else have this problem? Suggestions?

1 Like

Hello Tim,

If you import CSV data into an existing table, you will be able to set the datatype for each field. However, if you want to create a new table based on a CSV file, it automatically sets the numeric fields to text. Just like you noticed.

There is a workaround for it with the API and using an automation service like N8N, Make, Zapier or Pipedream.

  1. First step is importing the data, just like you did. Now you have a table with a lot of fields of the type “text”

  2. Check the API documentation of your table. The endpoint https://api.baserow.io/api/database/fields/table/[IdOfTheTable]/ returns an overview of all your fields.

  3. You can modify the structure of the table with the API. However, you need a JWT token for this, the Authentication token only allows you the modify data in the table.

  4. Check the documentation at Baserow API spec. It shows the request you need to make to obtain an access_token. This token stays valid for 10 minutes

  5. Loop over all your fields of the second step and refer to https://api.baserow.io/api/database/fields/[IdOfTheField]/. Check the docs for more info: Baserow API spec. This operation allows you to change the datatype of the fields.

Regards
Frederik

Thanks, Frederik! Is the Import from Airtable functionality currently working? I’ve tried to do it that way but I just get an error message that says “Something went wrong.”

I also get the message “Something went wrong” during the import. I guess it is because the feature is still in beta.

FYI the airtable importer is flakey atm due to an airtable api change and fails approx 30-50% of the time so perhaps just try a few times, we are releasing a fix for this week in 1.15.0.