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 field
https://payloadcms.com/docs/fields/selectAlternatively you can use a text field and provide a validation method to make sure the string is among your pre-defined values
https://payloadcms.com/docs/fields/overview#validationalright ill try it out in an hour
This works really perfectly
Glad to hear that 🙂
Thanks alot
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.