Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

formattedValue from dropdown selection giving inconsistent results

Avatar

Former Community Member

xml format for the drop down:

<order>

<pref>

<prefVal phone="">Click to select</prefVal>

<prefMgr></prefMgr>

</pref>

<pref>

<prefVal phone="555-1212">J Street Location</prefVal>

<prefMgr>JoeSchmoe</prefMgr>

</pref>

<pref>

<prefVal phone="555-1213">X Street Location</prefVal>

<prefMgr>JoeSchmoe</prefMgr>

</pref>

</order>

I'm populating a text box with the selection (value bound to prefMgr). 

text1 =$.boundItem(xfa.event.newText)

What I'm also after is the text in prefVal (I'd also like the @phone attribute if possible).  Closest I've come is using this:

text2 = text.formattedValue

It yields prefVal's label, but it's the wrong one.  With every re-click, it continues to be incorrect, eventually sticking with one constant.

Obviously, I'm using formcalc, but I'm open to javascript...

Any help is appreciated!

1 Reply