Hi all, I was wondering if it’s possible to show the selection keys instead the values in documents.
I mean, we had a selection list (key-value) and we placed a dynamic dropdown in a document type.
The selection list that we had is something like that:
key: #113344
value: mainColour
As you can see, the document will show “mainColour” in the dynamic dropdown, but it’s a problem when an editor wants to change the hex because the editor will change the key and the value will be lost in the document.
The idea is trying to fill the selection list like:
key: mainColour
value: #113344
Doing that, the documents show “#113344”, is there a way to show the key instead the value from the selection list in the dynamic dropdown?
Thank you a lot!
Hello, shouldn’t the selection list have ‘mainColour’ as the key and the value ‘#113344’? Why are they flipped?
@david.bailey because editors want to set “mainColour” in the dynamic dropdown in the documents. Seems that the plugin shows the value instead the key.
Doing that, the documents show “#113344”, is there a way to show the key instead the value from the selection list in the dynamic dropdown?
because editors want to set “mainColour” in the dynamic dropdown in the documents. Seems that the plugin shows the value instead the key.
I’m confused. It seems you want to display the key but also display the value?
I think I understand the use-case, but afaik you can’t make it show the key. Just to be clear, you have a resource bundle with the key-values and a dynamic dropdown using it? Selection field configuration
One workaround is to add the key to the label eg. “mainColour”:“#113344 (mainColour)” so it displays both and you can still extract the hex in the front-end. Not ideal but gets around the issue. Putting the hex as the key will not work if it needs to be changed.
You could also have a static list in the dropdown with just the names (“mainColour” etc) for the users to pick in the document, and then the RB has corresponding key-values (“mainColour”:“#113344” etc) that you can fetch from the front-end as needed.
Mmm.. I think it’s not a RRBB, it’s a ValueList as you can see in the image below.
Would be better to do it with RRBB?
For the last approach you shared, it’s a good one but I have a question.
In case that editors wants to add more colours, they have to add a new value to the document type and then create the RRBB, right?
Sorry, my bad explaining. We want to display only the key in the dynamic dropdown.
The rest of the message was to bring context
You could use either, but seems like you need to de-couple the configuration of the colours with the selection you are giving the client. So yes you would need to update the document type. Unless you create another RB with the selections for the document, so that it can all be managed by editors. Only downside is the duplication of the keys since they have to manage 2 RBs.
Just to confirm you are on Content SaaS right? not PaaS/brXM
Finally, we did a static dropdown for place the colour names and RRBB where the key is the name of the colour and the value is the palette 
Seems a good way to manage the feature we want to implement.
Thank you a lot!
Regarding your question, yep, we are on Content SaaS 
Excellent! and welcome to the community 
1 Like