Skip to main content

Hey everyone,

I'm working on migrating data from an old database to a new Airtable base, and I've set up linked tables. I've also created a script extension that successfully migrates a record when I manually select it within the extension.

My goal is to embed this script in a button field on my interface. This button should allow users to run the script directly on the current record they are viewing, without having to open the script extension and select the record manually.

Here are my main questions:

  1. How can I pass the current record (the parent of the button) as an input context to my script when the button is clicked? I need the script to know which record it should operate on.

  2. I've noticed that when I link the button to my script, the button appears disabled. Is this because the script is expecting manual input (like selecting a record from within the extension itself), and if so, how can I configure it to be runnable directly from the button?

Any insights or examples on how to achieve this would be greatly appreciated! Thanks in advance.

Button fields can’t run scripts from interfaces. They can only run scripts from the data layer, because they require the scripting extension and extensions can’t yet be installed in interfaces.

Instead, if you want a button to run a script from an interface, then you need to add one of the interface’s button elements to your interface page, and you can trigger an automation that way.

Then, inside your automation, you can run a script and you can pass the triggering record ID using the input.config variables in the left margin of the script editor.

Hope this helps!

If you have a budget and you’d like to hire the best Airtable consultant to help you with this or anything else that is Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld


I’ve set something up here for you to check out

On click, the button triggers an automation that uses a script to update this record’s ‘Name’ value to ‘Test’.  To get this to work you’ll need to be in a context where a record is selected, and so a Record Review like above works, or you could use a Record Detail, etc

 

 


Reply