Creating a custom enum field

System Information
  • Strapi Version: v4.2.2
  • Operating System: macOS
  • Database: mySQL
  • Node Version:
  • NPM Version:
  • Yarn Version:

I want to create a field which gives the user the ability to choose from a list of option or type their own text values. Is it possible to achieve in strapi? If yes, please guide me in doing so.

Thanks in advance!

Edit: Sorry, missunderstood your question at first. Yes, there is an Enum field in strapi where you can define a list of selectable options. See Official Docs for more information: Fields for Content Types - Strapi User Guide

Yes, but instead of just letting the user choose from a pre-defined list of values (enum), the requirement is to allow the user to add a value to the enum field (if the required value is not present in the enum).

I would suggest you use a oneWay relation to a storage table for something like that. We usually call this type of thing a “tag model structure”

Can you please share any links to understand this?

1 Like

We usually call this type of thing a “tag model structure”

Could you please provide any more info about this?

lol, seems like it takes an eternity to get solution for the tool. Good luck buddy!

What is being suggested is that you create a new Content-Type like “tags” and a relation field in your other Content-Type like “posts” with a many-to-many relationship.

When someone wants to add a new tag, they create a new record in “tags” and then go back to the record in “posts” to add that new tag.

Creating new records on-the-fly through the relations component in Strapi is not supported yet.

ngl that is such a unnecessarily complex solution for a very simple problem statement.

It might be at the top of their priorities one day, or someone else’s who creates a Pull Request on Strapi’s Open Source.

Until then, other features are higher priority and this is the workaround solution.

2024 update - desperately looking for this feature. other solutions to this problem are giving me the ick