Hello,
I am trying to bind a text field in Designer 8.1 to a specific XML element.
An example of the XML structure:
<KeyValueGroup>
<ID>
<Name>Name1</Name>
<Value>Value1</Value>
</ID>]
<ID>
<Name>Name2</Name>
<Value>Value2</Value>
</ID>
<ID>
<Name>Name3</Name>
<Value>Value3</Value>
</ID>
</KeyValueGroup>
I have been trying to bind using $record.KeyValueGroup.ID[Name="Name2"].Value to return the value of the Name2 property, however Designer rejects this expression.
Would anyone be able to advise where I am going wrong?
I understand I could achieve this using a Javascript function that enumerates the ID array, but would prefer to find a solution not involving javascript if possible.
Any help much appreciated,
Matt
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Matt,
The $record refers to the current subtree of the Data DOM, so in your case $data.KeyValueGroup and $record are the same thing.
You also need a "." before the predicate.
Anyway, try $record.ID.[Name=="Name2"].Value
Good Luck
Bruce
Views
Replies
Total Likes
Hi Matt,
The $record refers to the current subtree of the Data DOM, so in your case $data.KeyValueGroup and $record are the same thing.
You also need a "." before the predicate.
Anyway, try $record.ID.[Name=="Name2"].Value
Good Luck
Bruce
Views
Replies
Total Likes
Many thanks Bruce!
Your solution worked perfectly and I have learnt something in the process!
It makes so much sense to have the "." before the predicate but it was something that never occurred to me!
Have a wonderful day,
Matt
Views
Replies
Total Likes