Question about Custom Object Capabilities -- How to Model a Picklist/Enum
It looks like Custom Objects supports only string, integer, boolean and number types. We need to add an element to our custom object that is essentially a picklist but it seems like we cannot do this without hardcoding. I get the following error:
{"errors":[{"code":"BadRequest","status":"400","title":"Bad Request","detail":"data.schema object instance has properties which are not allowed by the schema: [\"enum\"]"}]}
How are people working around this limitation?
-
I second the author. Custom object schema is supposed to support properties restriction as documented here. Unfortunately, this is not the case and the api reference shows lack of support for validation.
-
Hey Jena Miller,
Can you provide a copy of your request for me to take a look at? Let me know if you'd like to pull this into a ticket.
Thanks! -
Hey Eric Nelson
Thanks for following up! I did submit a ticket already and was directed to this community instead. Unfortunately, given the lack of response I have chosen to move forward with a different product's toolset so no need for further triage.
Thanks.
-
Hey D2iQ,
Sorry to hear about your less than ideal experience. We're a pretty small team that covers the community so it sometimes takes us a bit to get to every post.
Let us know if you need anything,
-
Hi Eric Nelson,
I am experiencing the same issue as D2iQ. Allow me explain further:
The documentation here clearly states the possibility to restrict a property to a fixed set of values while creating a custom object schema. It also lists other validation features.
On the contrary, the API reference here explains that keywords for validation such as "enum" are not supported in the schema. Which means that all the validation features listed in the documentation are not actually supported except for the "type".
Here is an example request that follows the documentation:
curl https://{subdomain}.zendesk.com/api/sunshine/objects/types \
-d { "data": { "key": "my_key", "schema": { "properties": { "my_property": { "type": "string", "enum": ["my_option_1", "my_option_2"] } } } } } \
-H "Content-Type: application/json" -X POST-v -u {email_address}:{password}
And here is the response:
{
"errors": [
{
"code": "BadRequest",
"status": "400",
"title": "Bad Request",
"detail": "data.schema object instance has properties which are not allowed by the schema: [\"enum\"]"
}
]
} -
Hey Ahmed,
That's very odd! I've been able to replicate this issue on my side. I've looped in the product team who owns custom objects to assist me with digging into this. I'll touch base as soon as we've tracked down the issue.
Thanks for your patience!
-
Hey Ahmed.. Unfortunately, we don't support enum. But thank you for calling out the discrepancy in documentation. I will get that updated. But the good news is that, we are working on a newer version of custom objects, which will include all the field types that a User or an Organization supports today. And will also work seamlessly with other Zendesk products like Triggers, Tickets etc. We intend to release this new version in the first half of next year.
-
That's great news. Thanks Ashwin Raju for the update.
Please sign in to leave a comment.
8 Comments