Script to create new fields

Hi,

I’ve been searching for a way to create a button (either in the table or in an app block, I don’t care where) that will create five new fields and make them appear in the currently selected view or in one specifically selected in script bock. Again, don’t care which way it works, as long as I can make this possible. I have a team where we do call lists for different events and every time we make calls, we (meaning I) create four new columns

  • Link to records field so people can select their name to say they are going to make the call
  • A checkbox field for tracking whether they made the call
  • A checkbox field for tracking if the person said they’ll attend
  • A checkbox field for tracking if they fully registered on our registration site.
  • A single line text field to use as a notes column.

So far I’ve seen a lot of ‘no’ answers for similar questions, but it seems like this should be possible from the scripting documentation. There is the createFieldAsync function in the API. I’m not trying to fill the field with any values, just create the field and leave it blank to be filled in manually by my team. Is there really no way to possibly do this? I feel like there must be an easier way to automate this with a script versus my current methods of either copying and pasting the columns I already have in a view and renaming them or creating each of the 5 columns from scratch every time, both of which actually take about the same amount of time to do.

Thanks in advance for any help you can give!

Creating fields in an app is fairly easy, though the feature is still regarded as an “unstable beta”: Airtable Blocks SDK

To my knowledge, you can’t create fields in a script.

May I ask why you need 5 new columns routinely created as opposed to storing this data in a junction table?

1 Like

It’s one-off uses. I work with teenagers and it’s much easier to just make new columns so it’s all right there and then we hide them. I would get rid of the columns or wipe them, except that we will use the historical data to see who is more engaged. Maybe I’m not 100% sure what a junction table is, though. I’ll do some Googling.

Instead of making batches of 5 new fields everytime you need new data, you’d have a second table that links to your main one with these fields:

  • Link to the original table
  • Date field (probably) so you can note which batch this data is from, or a Text field if you describe it some other way than the date
  • The 5 columns you routinely duplicate.

Then in your main table you could use 5 rollups or lookups to pull in the most recent data. You wouldn’t make any new fields the next time you need more data, you’d make a single new record in the second table.

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.