Help

Is there a more efficient way I can create new fields in my base?

Topic Labels: Base design Extensions Sync
413 2
cancel
Showing results for 
Search instead for 
Did you mean: 
DaniWernert
4 - Data Explorer
4 - Data Explorer

Hello!
I am appreciative of any help on this one! I have spend way to many hours of Youtube trying to figure this out. 

Problem: Cannot import a CSV file to a synced table

Scenario: I have a new table that is synced to another base (that part is working perfectly!), but when I try to build out the new table it will not allow me to upload a CSV because the table is being synced. I have 450 columns (fields) that I need to add that have already been mapped out in an excel file. I would LOVE to save hours of manually creating each field and have it upload into the synced file. I'm not worried about it updating the records (rows), I really just don't want to have to manually add each column. 

Is there any other workaround I can try?!

2 Replies 2

Perhaps try looking into scripting?  You'd retrieve all the fields and then create them programatically

I take it you're trying to create all the fields in the main table and upload the CSV there, and then have it sync over to the synced table in the other base?

Hi,

You can use this very simple script, but it has 2 disadvantages: it creates only fields of the same type, it creates them one-by-one, with approximately 2 fields/sec, so you have to wait 3-4 minutes for all.

let table=base.getTable('Table_1')
let newFields=['Field 1','Second field','And so on']
while(newFields.length) await table.createFieldAsync(newFields.shift(),'singleLineText') 

ensure you filled newFields=['....] correct, without empty strings, repeats etc.
ignore linter warning under newfields.shift()


But I would recommend NO-CODE and simple way.
To create a number of fields in bulk, you have to create a new table will all fields together, or you have to import data.
You can't import into synced table, but you do a simple join by paste.
- ensure you have no matching names in the current synced table and new fields to be created.
- create a new table with all your fields by importing CSV
- select first row, press Control+C

Alexey_Gusev_1-1725730087977.png

(it should react like "450 cells copied")


- switch to your synced table, scroll right to the end, create new field with the name matching first name of your selected fields (I mean in the table you imported from CSV)

- put mouse cursor in the cell, click on it. then press Ctrl+V to paste

Alexey_Gusev_0-1725729251644.png

If it's OK it will ask you to add more fields. formula fields will be added as text with their values. I guess, some fields like links, lookups will be added as text too.