CustomObjects
Create, delete, update, and query Custom Objects in Zendesk.
Select
The CustomObjects table supports the ObjectName column in the WHERE clause. This table supports the following operator: '='.
For example:
SELECT * FROM CustomObjects WHERE ObjectName = 'house'
Insert
You can insert any field into the CustomObjects table that is not read-only. To insert Properties details for a custom object, use the #TEMP table to insert the fields of the property. The fields of the Property are present in the CustomObjectField view.
For Example:
INSERT INTO CustomObjectField#TEMP (FieldName, Type, Description, Required) VALUES ('NumOfRooms', 'integer', 'The number of rooms.', true) INSERT INTO CustomObjectField#TEMP (FieldName, Type, Description, Required) VALUES ('NumOfBaths', 'integer', 'The number of baths.', true) INSERT INTO CustomObjectField#TEMP (FieldName, Type, Description, Required) VALUES ('Balcony', 'boolean', 'Whether or not balcony is there.', true) INSERT INTO CustomObjectField#TEMP (FieldName, Type, Description) VALUES ('PropertyAge', 'string', 'Old or new construction.') INSERT INTO CustomObjects (ObjectName, Properties) VALUES ('house', CustomObjectField#TEMP)
Update
You can update only Properties column in the CustomObjects Table. To update the properties details for a custom object, Use the #TEMP table to insert the fields of the property. The fields of the Property is present in CustomObjectField view.
INSERT INTO CustomObjectField#TEMP (FieldName, Type, Description, Required) VALUES ('CarParking', 'string', 'Whether or not car parking is available', true)"); INSERT INTO CustomObjectField#TEMP (FieldName, Required) VALUES ('balcony', false)"); UPDATE CustomObjects SET Properties = 'CustomObjectField#TEMP' WHERE ObjectName = 'house'");
Delete
To delete a Custom Object, the ObjectName is required.
DELETE FROM CustomObjects WHERE ObjectName = 'house'
Columns
Name | Type | ReadOnly | References | Description |
ObjectName [KEY] | String | False |
A user-defined unique identifier. Writable on create only. | |
CreatedAt | Datetime | True |
The time the object type was created. | |
UpdatedAt | Datetime | True |
The time of the last update of the object type. | |
Version | String | False |
The version of this schema. | |
Properties | String | False |
A description of the object record, up to a maximum of 32 KB. |