In the previous mission, you created a brand new cars custom table. This mission will add to the structure of this table by creating two linked fields. The linked fields will give us information on the contact selected for the car.
Create Linked Field: ContactName
1. Add a new field to your Cars table.
2. 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".
3. Under Field Type, choose Linked. This will bring up a few more options.
4. 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.
5. The Linked Field option displays a list of all the fields associated with the Contacts table, so scroll down and choose Name.
6. 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 field 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 is a read-ony field which will contain the selected contact’s name from the Contacts table.
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 linked via the Contacts table! This read-only field will now show the selected contact’s phone number from the Contact table.
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...
Mission 1 is complete! In Mission 2, we’re going to take what we’ve learned here and use it to build the framework of our Cars app. Exciting stuff!