Nov 15, 2024 12:34 PM
I am working on in a table whose purpose is to have all aircraft on market & recently sold as a mechanism to build an MLS type system. I am trying to create an automation to delete a record IF a record that is being imported/create whose MSN matches and the Sold Price was filed where as before it might have been blank (signifying the aircraft was available). For ease of explanation here is a simple table structure to reference. What is the best way to achieve that?
The question I have is that is I create a new record (via import of records) and the Aircraft Serial matches one t
Nov 15, 2024 01:45 PM - edited Nov 15, 2024 01:46 PM
There is no way to automate the deletion of records unless you write your own custom Javascripts or you use a 3rd-party automation tool like Make's advanced automations for Airtable.
I don't know Javascript, so I use Make to do this.
In your case, I would highly recommend deleting (or merging) your records simultaneously while your records are being imported into Airtable.
I demonstrate how to do this importing technique on this Airtable podcast episode.
Hope this helps! If you’d like to hire an expert Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld
Nov 15, 2024 06:24 PM
Hmm, would it be right to say that, if a record has an "MSN (from Aircraft)" value, as well as a "Price Sold ($)" value you want it to be deleted automatically? So with reference to the screenshot you've provided, records 2, 3, and 4 should be deleted?
If so, you can try an automation that triggers when "MSN (from Aircraft) and "Price Sold ($)" are not empty, and its action would be to run a script to delete that record:
let {recordId} = input.config()
let table = base.getTable("[NAME OF THE TABLE YOU WANT TO DELETE RECORDS FROM]")
await table.deleteRecordAsync(recordId)
Link to base
Note that this'll use one automation run per record deletion so if you're importing and deleting a lot of stuff frequently this might be an issue, and we'd need to find an alternative method to handle this. For your reference, a Teams plan has 25k automation runs per month!
I'm actually kind of curious what the business logic is too. It seems like this might be better handled via rollups and lookups, but I'm not really sure what you're trying to do and so can't say for certain. If you'd like to have a chat about that or could use some help setting up the automation above you can book a free half hour call here and we can see what we can do to improve your base!
Nov 15, 2024 09:57 PM
This is an interesting approach to managing aircraft records! Automating the deletion of matching records based on conditions like "MSN" and "Price Sold" is a smart move for keeping your table clean. While Airtable doesn't have built-in deletion triggers, using custom scripts or tools like Make seems like a great solution. If you're handling large datasets frequently, optimizing automation runs would be key. Have you considered using rollups or lookups for tracking sold records without deleting them? That could simplify things while preserving data history. Let me know if you need help refining this setup!