Custom labels for enum values. possible?

Is there any way to use custom (user friendly) labels for enum fields?
I would love to see something like:

real_value|Some real value
another_value|Another Value
username|Your User Name

Your thoughts?

5 Likes

Short answer for right now is no, we are discussing this internally at the moment.

A quick “fix” for you right now is to setup a content-type to store the values and use the oneWay relation type from where you want to “see” the labels to that storage content-type.

The oneWay relation is the far left one in the content-type builder.

1 Like

Thanks. I thought so. Just wanted to double check if I was missing something.

Just wanted to chime in that I came looking for this as well.

2 Likes

Thirded! :slight_smile:

Probably a tad early to share this but we are working on this for the v4. Keep in mind this image is a very early prototype so things might change a bit.

3 Likes

Looks great! Thank you.

That’s awesome DMehaffy!

Thanks for keeping us in the loop. Looking forward to v4!

Wow, this is much better!

Will you allow the user to select multiple values, and will this work with GraphQL?

I believe we are adding an array type that could function like this but I’d need to check with @Jab and @maeva to see if we were going to add a multi-select with predefined keys or not.

2 Likes

The multi-select won’t be available for the moment :slight_smile: (cc @DMehaffy )

1 Like

Has this been included in v4? I thought I noticed changes to the ‘enumeration’ fieldtype at one point when I was testing. Now, in v4.0.0-beta.13, nothing.

Not on first release, we had to cut back on a few things but I believe this will come in the near future

I have to say, this is very disappointing, to not have a label/value fieldtype for creating dropdown options. I recently tried the new v4 release and set up content-types for all my options fields in order to pull in via ‘Relation’ field, as was recommended by strapi personnel. Here’s what the database looks like just after setting up the content-types, without connecting by Relation. Does it look strange to you, too?

Please try to resolve the deficiencies of the enumeration field, or create the above Status field type, or simply a Category field type as soon as possible.

I would love this feature too :slight_smile:

@DMehaffy Have you forgotten about this feature ? :wink: - Or is it still on the roadmap ?

It somewhat got put on the backburner for now.

Maybe a good solution could be define on the schema something like this:

 "select": {
      "type": "enumeration",
      "enum": [
         {
          value: "research",
          label: "Research"
         },
         {
          value: "article",
          label: "Article"
         }]
}
1 Like

It has been a while since this was discussed but would really be a helpful option if there is any update on it.

Any update on this? it’s such a useful feature . hope this gets implemented soon