Help

Re: Running automation by pressing button - going round in circles

1755 0
cancel
Showing results for 
Search instead for 
Did you mean: 
unserrer
4 - Data Explorer
4 - Data Explorer

Hello

Trying to do something very basic.

I have created an automation where all the steps confirmed as working except the trigger which is a button trigger. My understanding is to connect a button to the trigger I have to select it in the interface.

So I go to the interface, add button but under Choose Automation no automations are showing. Quick Loom here.

Any help much appreciated!

16 Replies 16
Arthur_Tutt
8 - Airtable Astronomer
8 - Airtable Astronomer

Got it @unserrer - thanks for the video that was very helpful! So I believe in this case the issue is the 'Blank' template, which is not properly connecting to your table/records.

Remember that a trigger for an automation has to be triggered from a specific record, but in List View with all records present, Airtable won't know which record triggered it. See the problem?

A couple thoughts:

Could you try creating a Record Review style layout and then add your button and list as elements? (screenshots). 

Screenshot 2023-11-01 142007.png

Screenshot 2023-11-01 141546.png

If that works, great. If not, can you tell me a little more about what your automation is intended to do, and what data it needs to trigger? There might be better ways of setting up the trigger for the automation. 

 

Let me try and explain what I am trying to do.

I have a whole bunch of records. I want to go through them, select a few (have created a checkbox property so that the automation can work with them) and then output the records I have selected to a CSV.

Ideally list interface would be best so I don't have to go through each record.

 

Arthur_Tutt
8 - Airtable Astronomer
8 - Airtable Astronomer

hey @unserrer alright I've got something for you. May not be a perfect solution, but will get the job done. As I understand it you've got the export to CSV automation working fine, it's just about having the correct trigger to launch it. Recorded a Loom Video to take you through step by step. Here's my example:

*** Remember to change all my Table / Field / Variables to match yours ***

Base Setup:

Screenshot 2023-11-01 153424.png

Automation Trigger Setup:

Screenshot 2023-11-01 153518.png

 

Automation Script (to get data of ALL records with export box checked)

var dataTable = base.getTable("Form Data")
var dataQuery = await dataTable.selectRecordsAsync({fields: ["Field A", "Field B", "To Export"]})
var dataRecords = dataQuery.records;
console.log(dataRecords)

var exportDataType = dataRecords[0].getCellValue("To Export")
// console.log(exportDataType)

var exportedData = [];

for (var i = 0; i < dataRecords.length; i++) {
  if (dataRecords[i].getCellValue("To Export") == true ) {
    exportedData.push({
      "Field A": dataRecords[i].getCellValue("Field A"),
      "Field B": dataRecords[i].getCellValue("Field B")
    })
  }
}

console.log(exportedData)

 

 Automation Output:

Screenshot 2023-11-01 153739.png

 

That's amazing! Thank you so much! I've still got my fundamental question though - my automation seems to work but Airtable isnt letting me assign an automation to the button!

Arthur_Tutt
8 - Airtable Astronomer
8 - Airtable Astronomer

@unserreryeah it's super frustrating, but I think you're trying to do something that Airtable is not designed for (hence why the automation option is grayed out for you).

I gave you a solid workaround, will it get the job done for you for now? 

unserrer
4 - Data Explorer
4 - Data Explorer

Am going to try that tomorrow thank you! Really!

Arthur_Tutt
8 - Airtable Astronomer
8 - Airtable Astronomer

Awesome, let me know how it goes!