In this section we’ll create a custom table and populate it with the fields we’ll need to build our app.
Create a new table
- Click the Gear icon in the right hand corner and select Preferences.
- On the left-hand side, click Tables and Fields.
- Click New Table to open the New Table screen.
- Choose a name for our table: let’s call it “Cars”.
- Click Save to create your new table! You will be taken to the field list screen, where you can see your table has one field already in it, the RecordID field.
Create a basic fields
- Scroll to the bottom of the grid, and click New Field.
- Give our field a name that makes sense. Call it "CarName" to keep track of its name. Keep the default field type to Text. The process of creating and adding a field is the same for all field types.
3. Create another field called "LicensePlate" also of type Text. You will have two text fields:
4. It’s a good idea to add an IsActive field to our table so we have the ability to mark an entry as inactive without deleting it. This field type is "YesNo", so title it IsActive and select the field type from the list. Then click Add field.
5. Sometimes it’s helpful to keep track of when records are created and modified in a list, so let’s add two "DateTime" field types to our table.
Create dropdown fields
Here’s where things get interesting: we’re going to add two dropdown fields to our table. Remember how dropdown fields create relationships between two tables? Our first dropdown field will create a relationship between the Cars table and a table that already exists in Method, the Contacts table.
- Create a New Field
- Call our first dropdown field Contact.
- Select "dropdown" from the field type menu.
- We want to associate this field with the Contacts table, so for Table select Contacts.
- You’ll be prompted to choose which field in the Contacts table you want to associate with your dropdown. Let's choose the unique option: RecordID.
6. Click Save, and you’ll see your Contact field appear in the list of fields for the Cars table.
Under Field Type, it lists the Table Name, indicating this is a "dropdown" field type. If you select it, you will be taken to the Contacts table.
Let’s move on to our next dropdown field, which we’ll call “CarMake”.
- Create a New Field
- Field Name: CarMake
- Field Type: Dropdown
- Select "Create field based on new table"
- In the text box that appears, type in different makes of cars. There will be one per line: BMW, Volkswagen, Toyota, Ford
6. When you’re all done, click Save. You’ll be returned to the field list for your Cars table.
You're finished! If you go back to your Tables list, you’ll see the two new tables created. The first one is your Cars table, and the second is the CarMake table which is a dropdown in the Cars table!
There’s one more nifty function of tables and fields in Method we’d like to address. In the last mission we created a relationship between the Cars table and the Contacts table using the Contact dropdown. Let’s monopolize on that relationship and create a linked field!