Asset Builder - Select Field keys


(Emily) #1

Matrix Version: 5.5.2

Hello again brains trust,

I am trying to find a keyword (or modifier) to get my Asset Builder to output a Select metadata field
to print the value (instead of key) in the option tag.
i.e. <option value="ValueText">ValueText</option>
rather than <option value="KeyText">ValueText</option>

I have tried %metadata-F_1234_values% , %metadata-F_field_1234_values% , %metadata-F_1234^as_asset:{various keywords tried here}% … … :exploding_head:

Is there a way I can get it to do what I want?

Why? We have a piece of code which is reading the “value” of the input fields, and then printing it into a preview pane as it is entered. This works for text fields. Our Key is numerical, whilst out Value is text. The Key is also used to represent in a graph, so we need a numerical value as one half of the key/value pair. If I swap the Key to be the text and the value to be numerical, then the Text printed between the Option Tags is the number - not the text (but if this can be altered, I am also OK with that, but changing the “frontend part” does not do this).
(In the mean time, I will get the Javascript code changed to have a varient for the Select options to read the options.text rather than .val – but if it is possible to print is as I originally desire, then I’d still like to know for future!)


(John gill) #2

Unlikely, and even if you could it would prevent the field from being correctly submitted to the Asset Builder.