Help

This Product Ideas board is currently undergoing updates, but please continue to submit your ideas.

Press Button in Interfaces

cancel
Showing results for 
Search instead for 
Did you mean: 
Dennis_Petrou
7 - App Architect
7 - App Architect

In one of our tables, we use the Button field as a trigger to run a script.
We have been using Interfaces as a much cleaner way to enter data for some of our teams, but it seems like you can bring that field into Interfaces but the button is not actually clickable.

Is there a workaround for this? Will this be added?

Thanks!

7 Comments
Joe_Hewes
7 - App Architect
7 - App Architect

You can’t run the script block from an interface. You could switch to an automation triggered by a check box instead?

Dennis_Petrou
7 - App Architect
7 - App Architect

Yeah I thought of that. Trying to avoid using another automation if possible, we only get a certain number of them and use a lot.

I cannot see any way to run the script from within the interface. In our regular AT, we have a simple button but when I bring that button into the interface its faded and unclickable.

Thanks

Dennis_Petrou
7 - App Architect
7 - App Architect

Ok so I’m trying to use the same script that we use with the button for the automation triggered by the check box.

The script is giving me this error: TypeError: input.recordAsync is not a function
** at main on line 10**

which I know is because the input.recordAsync is specifically for buttons (learned this searching the forums)

Any idea how I would modify the script to work in the automation? This is the section of the script in quetsion:

// get the parent table and record
const parentTable = base.getTable(parentTableName);
const parentRecord = await input.recordAsync(“Pick a record”, parentTable);
const parentRecordId = parentRecord.id;
const numChildren = parentRecord.getCellValue(fieldNameNumChildrenToCreate);
if (!parentRecord.getCellValue(linkedfield)){

any help is appreciated, I’m way over my head here.

Joe_Hewes
7 - App Architect
7 - App Architect

Use the automation input variables instead of prompting for a record (that’s for the app only)
Great guide here: Airtable automations and scripts | Airscript

Dennis_Petrou
7 - App Architect
7 - App Architect

Thanks for the guide and suggestion! I’ll have to dig in and see if I can make sense of this, never done anything like this before (I was using an existing script and trying to modify)… I think I’m way over my head, but thanks!

Joe_Hewes
7 - App Architect
7 - App Architect

One you get used to it it makes perfect sense. Coupled with the built in output function you can take an input field, process it with scripting and then use the output at the next step of an automation. For example as content for an email, storing it in another field or even sending to a third party api.

Dennis_Petrou
7 - App Architect
7 - App Architect

I tried and couldn’t figure it out. If I knew the first thing about scripting it would be helpful, I thought I could use that guide to figure out how to just modify the existing script to work with the automation vs. button but alas, I have failed miserably. Thanks for your help though!