views:

599

answers:

1

I have two data connections. One (we'll call DC1) pulls FIRSTNAME and LASTNAME from a database. The other, (we'll call DC2) uses this information to query a web service that returns a USERNAME after matching it to another database.

On my form, I have a repeating table that lists all the information from DC1. In the repeating table, I want to have ANOTHER textbox that returns the USERNAME from DC2 using the current row's information. like so:

FIRSTNAME LASTNAME USERNAME etc....

My two data connections work, because I can query DC2 without issue, and the repeating table properly displays information from DC1.

How can I add the USERNAME textbox (which contains the USERNAME returns from DC2 after comparing FIRSTNAME and LASTNAME) to the repeating table? Everything I have tried does not work - mostly, I just get repeating information in the USERNAME boxes in the repeating table. Thanks

+1  A: 

This problem shows a real failing in the XPath implementation InfoPath uses. You will not be able to do it without managed code.

This blog article shows an example of how to populate a repeating table with data.

You will need to make a repeating table in your main datasource that will store the combined data. Then in your Loading event function (or whenever you pull the data from your DC's) populate the repeating group in your main datasource with the data from your two DC's.

oillio