Working with Tables
Learn how to manipulate your data in your Tables in Morph, with the Field and Record objects.
Overview
Tables in Morph are made of Fields and Records.
- The Fields define the structure (schema) of Table.
- The Records are the content of a Table.
Learning points
In this guide, you will learn:
- How Tables are defined in the Morph API.
Structure of a Table in Morph
The structure of a Table in Morph is defined by its Fields.
In most real-life scenarios, a Table has several Fields, i.e. List of Fields.
In the Developer Mode, when you select a Table, you can see the structure of that Table, that is its list of Fields. Click on the Structure
button, located on the top right corner of your screen.
A Field object is the data representation in Morph API of a single Field that you can see in the Developer Mode (and Dashboard).
However, that data representation of a single Field object in Morph API contains more information than what is shown in the Developer Mode (and Dashboard).
A single Field object is represented in Morph API as shown below. Head to the Field object for the full description of each property.
Complete data representation of a single Field object in Morph API
{
"name": "string",
"displayName": "string",
"type": "shortText",
"default": "string",
"nullable": true,
"comment": "string",
"length": 0,
"unsigned": 0,
"members": [
"string"
],
"formula": "string",
"relations": [
{
"targetTable": "string",
"targetField": "string",
"targetTableFields": [
{}
]
}
],
"originalTableSlug": "string",
"primary": true
}
Example with values of a single Field object in Morph API
An example with values of a single Field object. This is the Regional Office
field taken from the employees Table created by CSV import in the Quickstart.
As you might have noticed in this example below, not all of the properties of a Field object are necessarily used. This is because some properties of a Field object are optional. Head to the Field object to learn more.
{
"name": "regional_office",
"displayName": "Regional_Office",
"type": "singleSelect",
"default": null,
"nullable": false,
"comment": "Regional_Office",
"members": [
"Central",
"East",
"West",
"US"
],
"originalTableSlug": "employee_csv",
"primary": false
},
Next steps
How to work with Records:
- How to add a new Record to a Table.
- How to find Records in a Table.
- How to update a Record in a Table.
- How to delete a Record in a Table.
Updated 6 months ago