Add Item To Dropdown List Box Populated By Secondary Data Source

E

Ezack

Hello,
I need to add an item to a dropdown list box that is populated by a
secondary data source (web service). I do not need to persist this value to
the secondary data source. I only need it in the dropdown. It's basically
an "Other" option. How can I do this?

THanks,
ezack
 
S

Swathi (GGK Tech)

Hi,
Create an xml in which it contains both web service data and the ‘other’
value. And get the values in to drop down by using this xml.
 
E

Ezack

Can you clarify a little what you mean by this? How do I "create an xml"?
Can I do this in InfoPath?

-ezack
 
S

S.Y.M. Wong-A-Ton

Since you cannot use rules to add an item to the drop-down list box (or the
data source that is bound to the drop-down list box), you will have to write
code to get this done.

First you must retrieve a reference to the secondary data source using the
DataSources object (see
http://www.bizsupportonline.net/infopath2007/infopath-basics-main-secondary-data-source.htm).
Once you have a reference, you can copy the structure of an existing
repeating node from the secondary data source, change the values to contain
the values for the 'Other' item, and then add the new repeating node to the
secondary data source. You can do something similar as described in this
article:
http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm
 

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