There are a number of things you need to understand about fields before creating your own table, and this article will cover field attributes and types. We will be showing screenshots from viewing a table so you can familiarize yourself with the icons and terminology used.
If you are wondering where to view and create tables, this is covered in greater detail in Creating Custom Apps.
For this article, we will use a fictional table which will hold data for pets.
When you view a table, you will notice some icons beside the field names, and when you hover over the icons, it will inform you of the attribute.
Let’s say you have a table that holds customer records. A required field is the field that must be filled out in order for the record to save to the table. While the specific fields may vary from table to table, any table can impose rules of this kind. For example, our pets table requires the Name field to have a value in it in order for the record to save. This makes logical sense because what would be the point in saving a customer with no name?
A unique field, on the other hand, refers to the value itself. Basically, a unique field is one whose value is different than any other value currently saved in that table. As mentioned before, the RecordID field is a unique field to uniquely identify the record. In our pets table, imagine there is a record for the pet "Fluffytron." If Fluffytron has a RecordID of 13, no other record in the pet table will have 13 as their RecordID.
Fields will have a field type which will dictate the data it holds. This will effect:
It’s important to note that every field you use or create in Method will fall into one of these types, but don’t worry - they cover all the bases! The field types are:
You’re probably familiar with dropdown fields from other websites you’ve used in the past: the kind you click on and then choose from a pre-existing list that - well, drops down.
In Method, the list of items shown in a dropdown is stored in yet another table. When creating a dropdown field, you can choose to create a brand new table to hold custom data, or select an existing table
In our Pets example, there is a dropdown field which we named Owner: This "Owner" field actually pulls data from the existing Method table, Contacts. Pictured above is how the Owner field looks when viewing it in the table. It will indicate the table it is pulling data from (Contacts), and the field which will be used to uniquely identify each record (RecordID).
Okay, here’s where things get a little more complicated. A linked field is a field that displays the value of a field in another table which has been established via a dropdown. That sounds confusing, so let’s use another example to illustrate what we mean.
Our Pets table has a dropdown field that pulls from the Contacts table. Once a user has chosen a value within the dropdown field, wouldn't it be handy if we could have quick access to other information from that contact?
For example, if we have chosen Bob Crenshaw as the Owner, what if we also want to grab his email, or his phone number, or his address and place it in our Pets table?
Instead of copying and duplicating the information from the Contacts table, you can create a linked field which will return the information Contacts table.
In the above example, we have created three linked fields:
You may be wondering why you need to create a linked field. One of the main reasons is displaying data in a grid. A grid can only show information from one table. If you were to display the pets table in a grid, what if you want to show the phone and email of the owner, which is taken from the Contacts grid?
By creating linked fields, you link the information in the Contacts table to the Pets table, and thus can display it in the grid!