Learn how Field objects are defined in Morph API.
In Morph API, Fields are defined as Simple Field objects.
SimpleField object
Properties and types
Key | Type | Description |
---|---|---|
name | string | |
displayName | string | |
type | string | Possible values are: - "shortText" - "longText" - "singleSelect" - "multiSelect" - "datetime" - "date" - "time" - "number" - "decimal" - "boolean" - "autoNumber" - "email" - "image" - "attachment" - "createdAt" - "phoneNumber" - "url" - "richText" - "formula" - "createdBy" - "lastEditedAt" - "lastEditedBy" |
default | either of the following types: - string or- number , or- boolean , or- array of string | |
nullable | boolean | |
comment | string | |
length | number | |
unsigned | number | |
members | array of string | |
formula | string | SQL statement |
relations | array of Relation object. | |
originalTableSlug | string | |
primary | boolean |
JSON representation
{
"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
}
Relation object
Properties and types
Key | Type | Description |
---|---|---|
targetTable | string | |
targetField | string | |
targetTableFields | array of targetTableField object |
JSON representation
{
"targetTable": "string",
"targetField": "string",
"targetTableFields": [
{}
]
}
targetTableField object
Only used in response
Properties and types
Key | Type | Description |
---|---|---|
name | string | |
displayName | string |
JSON representation
{
"name": "string",
"displayName": "string"
}
"shortText"-
"longText"-
"singleSelect"-
"multiSelect"-
"datetime"-
"date"-
"time"-
"number"-
"decimal"-
"boolean"-
"autoNumber"-
"email"-
"image"-
"attachment"-
"createdAt"-
"phoneNumber"-
"url"-
"richText"-
"formula"-
"createdBy"-
"lastEditedAt"-
"lastEditedBy"
Value type
Pass specific format values when you call record APIs.
simple field | format | remark |
---|---|---|
shortText | "string" | |
"string" | "string" | |
singleSelect | "string" | |
multiSelect | ["option1", "option2"] | |
datetime | one of [YYYY-MM-DD, YYYY-MM-DD hh:mm:ss, YYYY-MM-DDThh:mm:ss, YYYY-MM-DDThh:mm:ss.sss, YYYY-MM-DDThh:mm:ss.sssZ] | |
date | YYYY-MM-DD or YYYY/MM/DD | |
time | HH:mm | |
number | 1 | |
decimal | 1.1 | |
boolean | true / false | |
[email protected] | ||
image | https://sample-image.jpg | |
attachment | https://sample-attachment.pdf | |
url | [http or https]: //sample.com | |
richText | {} |