populate main data source with secondary source

M

Max

Hi,
I am new to InfoPath.
I would like to populate a repeating table in my main data source with a
secondary data source results from a web service, so that i can submit it
back to the DB with new changes or added info.

The main data source is designed from a schema I created.
The secondary data source is a web service that i call.

Here is an example:
I have a Form which has a dropdown of existing Customer Profiles or you can
manually create a new Profile by not selecting the dropdown and just entering
the rest of the info.
Each Customer Profile can contain multiple Contacts (repeating table).
Contacts has several peices of info. like Name and Email.

In the form i have a repeating table for the Contacts.
Which allows me to add Contact info. manually.

I would like, if I selected an existing Customer Profile that the "Contact
repeating table" from the main datasource be populated with all the Contacts
for that existing Profile from the 2ndary data source so that i can edit any
existing Contacts or even add a new Contact.

Currently with the dropdown i give it a Rule to set a field in the "Contact
repeating table" but it only displays the 1st result and not all of them. I
imagine if you can put 1 contact it should be able to put all.

Is this possible without having to create another form for just the Contacts?
 
G

Greg Collins [InfoPath MVP]

Yes, rules will only copy over the first one. You will need to write code to create new rows and popualte them, then insert them into the main DOM.
 
M

Max

Thanks Greg,
I really appreciate your help.

Is there anyway you can point me in the right direction, or perhaps you know
of an example somewhere on the net. I know how to get to the Microsoft
Script Editor. Is there any documentation regarding the use of Microsoft
Script Editor.
Do you know if i will need to create a button for this "event" or is this
something that can automatically occur when the results come from the web
service?

Thanks again.
 

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