Aug 21, 2024 07:48 PM
I have a problem with related tables.
Button 1: When you click the "Add" button, it does not automatically fill out the foreign key. However, you can cancel the form at any time, so it will not be saved in the database.
Button 2: This button automatically relates the record to the parent table. However, if you do not fill out the Mailing Address and Source fields, the record is still saved in the database. Therefore, if you accidentally press the "Add Record" button, you will need to delete it manually.
Questions:
Aug 22, 2024 02:05 AM
Hi demo22,
Button 1 launches a form. This will allow you to add data to what will be a newly created record in the table you are using to store mailing addresses. You can add or remove any of the fields in that table that accept input (so not formulas, for example). When you refer to a foreign key, I think you are meaning what is called in Airtable as a linked record field. You can select an existing record in the linked table by its primary field value while completing the form. This is not automatic, but a manual process of selection, although you can use default field values where the same value should always be selected. The record is not committed until you press the confirm button.
Button 2 adds a new blank record. If you do not subsequently add data to the record it will remain in the table until deleted. If you wanted to automatically remove blank records at a specific time of the day, or similar, you could write a script to do this.
Aug 22, 2024 02:15 AM
If you want to control record creation so that all newly created records must have some or all of the fields completed, you can do the following:
1. Hide button 2 by toggling off "Add/delete records inline" for that interface element.
2. Force record creation via a form (button 1) and then make those fields required.