Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Re: Inquiry about the buttons in related tables

260 0
cancel
Showing results for 
Search instead for 
Did you mean: 
demo22
4 - Data Explorer
4 - Data Explorer
 

demo22_1-1724294583124.png



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:

  1. How can I fill out the foreign key in Button #1?
  2. If I use Button #2, how can I prevent the app from saving the data in the database if I haven't filled out the Mailing Address and Source fields?
2 Replies 2
Dominic
6 - Interface Innovator
6 - Interface Innovator

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.

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. 

Screenshot_2024-08-22_at_11_10_14.png

 2. Force record creation via a form (button 1) and then make those fields required.

Screenshot_2024-08-22_at_11_10_46.png