Different name displayed and value created from XML source

J

Johan Nilsson

I have what I assume is a newbie problem when I have created a cascading
repeating table from an XML source. I want one value to be displayed and
another registered when choosing that option.

For example, you choose 'Value1' from a dropdown list called
'FirstDropDownList' and based on that choice you your options get populated
in the second dropdown list. In this list I would like to see one value
displayed and another registered. At the moment one of the rows in my xml
document looks something like this:

<FirsDropDownList="Value1" SecondDropDownList="ABC123" />

I can see in InfoPath that you can choose a value and a display name but
when chosen I can only choose SecondDropDownlist for both display and data
value.

How do I rewrite my XML source to be able to choose different values and
displaynames?

Thnks in advance
 
S

S.Y.M. Wong-A-Ton

Your XML must have more than one element and/or attribute in your repeating
nodes to be able to set a value that differs from the display name.

Try the following structure:
<dds>
<dd1 FirstDropDownList="Value1">
<dd2 id="123" SecondDropDownList="ABC123" />
<dd2 id="345" SecondDropDownList="ABC345" />
</dd1>
<dd1 FirstDropDownList="Value2">
<dd2 id="678" SecondDropDownList="ABC678" />
</dd1>
</dds>

Settings for the first dropdown:
Entries: Select "dd1" node
Value and display name are automatically set to @FirstDropDownList since
"dd1" has only 1 attribute (FirstDropDownList).

Settings for the second dropdown:
Entries: Select "dd2" node and filter data on FirstDropdownList = <field in
the main DOM representing first dropdown list on InfoPath form>
Value: Select "id" under "dd2" node
Display name: Select "SecondDropDownList" under "dd2" node


You could also use a structure like the following:
<dds>
<dd1 FirstDropDownList="Value1">
<dd2 id="123"><SecondDropDownList>ABC123</SecondDropDownList></dd2>
<dd2 id="345"><SecondDropDownList>ABC345</SecondDropDownList></dd2>
</dd1>
<dd1 FirstDropDownList="Value2">
<dd2 id="678"><SecondDropDownList>ABC678</SecondDropDownList></dd2>
</dd1>
</dds>


Or one like:
<dds>
<dd1 FirstDropDownList="Value1">
<dd2><id>123</id><SecondDropDownList>ABC123</SecondDropDownList></dd2>
<dd2><id>345</id><SecondDropDownList>ABC345</SecondDropDownList></dd2>
</dd1>
<dd1 FirstDropDownList="Value2">
<dd2><id>678</id><SecondDropDownList>ABC678</SecondDropDownList></dd2>
</dd1>
</dds>


Does this work for you?

Regards,
S.Y.M. Wong-A-Ton
 
J

Johan Nilsson

Excellent, this was exactly the information I was looking for.

Much appreciated =)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top