It's all about the answers!

Ask a question

DNG RPE How do you publish the text value of an enumeration?

Sean F (1.3k22567) | asked Apr 16 '18, 11:39 a.m.
edited Apr 16 '18, 11:41 a.m.

When publishing enumerated attribute data from DNG using RPE the values come out as integer indexes.

Say there is an enumerated attribute Priority

It will have enumerations

0 - High
1 - Medium
2 - Low

Each enumeration value has an integer and a string value.

The 'value' extraction in the DNG Text schema using:-


returns the value '0' instead of the value "High"

How do you get the value 'High' ?

There is also a TS node:-

but that does not return anything in my experimentation

Kumaraswamy Gowda commented Apr 16 '18, 11:56 a.m.

I couldn't find much information at DNG Rest API wiki.

Sean F commented Apr 16 '18, 12:40 p.m.

Thanks for having a look anyway Kumar

4 answers

permanent link
vanessa lavender (211) | answered Jun 20 '18, 11:35 a.m.

 We use literal name instead of value and it prints out the text instead of the number. 

permanent link
Matthew OReilly (413) | answered Apr 16 '18, 10:09 p.m.
edited Apr 16 '18, 10:10 p.m.
Hello Sean,

This is how I did it; not elegant, but it works for me. "Priority Attr" is a custom attribute

if (name  == "Priority Attr")
    switch (Number(value))
        case 0:
        case 1:
        case 2:
        case 3:
        case 4:

permanent link
Sean F (1.3k22567) | answered Jun 20 '18, 1:55 p.m.
^^Thanks for the reply Matt. I was worried it was going to be something complicated like that.

^Thanks Vanessa. That looks like a nice simple solution. I will give that a try.

permanent link
Matthew OReilly (413) | answered Jun 24 '18, 8:33 p.m.
Vanessa's method works well, much neater and lower maintenance than  the Case statement.


PS: Note is does NOT display text in the RPE 606 preview; but then again, neither does my method. For me, it only works for a full document generation.

Your answer

Register or to post your answer.