In this mission, we are going to add TWO linked fields!
Linked Field: ContactName
- Add a new field to your Cars table.
- The Field Name is very important here as it defines how the field will display when you drag it onto a screen in the Design Mode (more on that later), so let’s be explicit and name it ContactName.
- Under Field Type, choose Linked. This will bring up a few more options.
- Linked Using will define which dropdown you’re going to reference. Since we want to make use of the relationship with the Contacts table, choose Contact.
- The Linked Field option displays a list of all the fields associated with the Contacts table, so scroll down and choose Name.
- The screen should look similar to what is pictured. Click Save.
You'll be returned to the Cars Table field list. See how the field ContactName is now listed?
- The Contacts is a dropdown field, connected to the Contacts table via the RecordID field.
- Beneath is the ContactName field. It is indented and has a link icon to show it is a linked field.
- The ContactName field also shows it is linked to the Name field of the Contacts table.
This field will now pull the selected contact’s name from the Contacts table and populate the ContactName field with it.
Linked Field: ContactPhone
Now to add a second Linked Field! We'll use this to display the phone of the contact. Let’s name this one ContactPhone.
1. Add a New Field
a. Field Name: ContactPhone
b. Field Type: Linked
c. Linked Using: Contact
d. Linked Field: Phone
2. Click Save to save the linked field.
And there you have it – ContactPhone is listed, linked via the Contacts Table! This field will now pull the selected driver’s phone number from the Contact table and populate the ContactPhone field with it.
Note: What happens if your contact doesn’t have a phone number in his contact record? Absolutely nothing! The field will be left blank.
Coming up next...
In the next mission, we’re going to take what we’ve learned here and use it to build the framework of our Cars app. Exciting stuff!