Is it possible to have a field that only accepts specific strings
Eg status field only accepts these values (“open”, “close”,”pending”)
anyone will be able to add a row to the table through GRAPHQL or rest api
and admin will be able to update the status via the payload dashboard but to specific values from drop-down
How can I go about this ?
The easiest way would be to use a select fieldhttps://payloadcms.com/docs/fields/select
Alternatively you can use a text field and provide a validation method to make sure the string is among your pre-defined valueshttps://payloadcms.com/docs/fields/overview#validation
alright ill try it out in an hour
This works really perfectly
Glad to hear that 🙂
Get help straight from the Payload team with an Enterprise License.