- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 27, 2023 09:05 AM
Hi Airtable community! New user here,
I am working with three tables in Airtable: 'Families,' 'Codes,' and 'Vases.' Each family in the 'Families' table can have multiple codes in the 'Codes' table, and each code in the codes table can have multiple vases in the third table. The objective is, for each new record, to automatically generate and assign unique codes for each family in the 'Codes' table and each code in the 'Vases' table. When assigning a new code, Airtable should automatically tell me the last code used for that family and assign the next one (for example if xxx-1 exists already, then assign xxx-2) The code format should include the family number followed by a numeric increasing value (e.g., 1, 2, 3). The count should reset for each family, ensuring that each family has its sequence of code numbers. The goal is to implement script in the Airtable Scripting Block that triggers whenever a new record is created on the codes and vases table, ensuring the proper assignment of these unique codes based on the family they belong to.
Maybe my Scripting block approach is wrong and perhaps the problem is easier to fix than what i think the solution is, Any help would be amazing.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 27, 2023 09:51 PM - edited Dec 27, 2023 09:53 PM
Hello @danielnorena
If you need your unique data in the Primary Field(first field). Then using a formula and combining multiple fields of data with a specific format makes more sense.
Check these references
- Using Formulas in Airtable & Primary Field | Airtable Support
- Understanding the Primary Field in Airtable - YouTube
- Why You Need a Unique Identifier and Primary Fields in Airtable - YouTube
If you need to apply things on other regular fields then you can also use the same formulas and just construct it.
👍
