Nov 01, 2023 07:30 AM
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!
Nov 01, 2023 11:23 AM
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).
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.
Nov 01, 2023 11:27 AM
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.
Nov 01, 2023 12:38 PM
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:
Automation Trigger Setup:
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:
Nov 01, 2023 02:19 PM
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!
Nov 01, 2023 02:55 PM
@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?
Nov 01, 2023 02:58 PM
Am going to try that tomorrow thank you! Really!
Nov 01, 2023 04:15 PM
Awesome, let me know how it goes!