CreateField
Create field
Description
Create a field by specifying data_type
The data_type in the table below can be specified.
※The items that can be set differ depending on the data_type (type) of the field to be created.
data_type | Item type | Unique key | Use for title | Use for search criteria | Availability of search index | Target for full-text search | Display in list | Not displayed when action is executed | Not displayed in API results |
---|---|---|---|---|---|---|---|---|---|
text | Text | 〇 | 〇 | 〇 | 〇 | 〇 | |||
textarea | multi-line text | 〇 | 〇 | 〇 | |||||
select | Options | 〇 | 〇 | ||||||
radio | Radio | 〇 | 〇 | ||||||
checkbox | Checkbox | 〇 | 〇 | ||||||
autonum | Auto numbering | 〇 | 〇 | 〇 | 〇 | ||||
number | Numerical value | 〇 | 〇 | ||||||
calc | Calculation formula | 〇 | 〇 | ||||||
datetime | Date and time | 〇 | 〇 | ||||||
file | Attachment | 〇 | 〇 | 〇 | |||||
users | User | 〇 | 〇 | ||||||
dslookup | Database reference | 〇 | 〇 | ||||||
label | Label | ||||||||
separator | Separator |
Method
POST
Request URL Format
/api/v0/applications/:app-id/datastores/:datastore-id/fields
URL Params
app-id : Application ID (ID entered from the Hexabase screen)
datastore-id : Data store ID (ID entered from the Hexabase screen)
Request URL Sample
POST https://api.xxx.com/api/v0/applications/624bea3a879f4e8d8b5dcc6f/datastores/639912c0b1ea5632b8bc0545/fields
Payload
Detailed settings for each data_type are available at UpdateField
{
"dataType": "text",
"name": "フィールド名", // (Required)Screen Item Name
"display_id": "Fld-MzZNUHau", // screen item ID
"search": true, // Set "Use as search condition"
"show_list": true, // Set "Show in list"
"as_title": false, // Set "Use as Title"
"full_text": false, // Set "Target for full-text search"
"unique": false, // Set "Unique Data"
"hideOnInput": false, // Set "Do not display when action is executed"
"hide_from_api": false, // Set "Do not display in API results"
"has_index": false, // Set "With or without search index"
"roles": [ // Set Permissions (Application Admin role is granted automatically)
"MEMBER", // Specify role ID
"624bea3a879f4e8d8b5dcc72"
]
}
Response Sample
{
"display_id": "Fld-MzZNUHau",
"field_id": "63c8dd1bc381e7e523178b97"
}