jimmy, your example was closer to what I was trying to do. Perhaps because of my inexperience with xpath, I'm pretty much stuck at the same place with yours as I am with the other kind gentleman's example - figuring out what I need to type in to get my form to do something similar.
With your form, I see
employee[@employeeId = current()]/@name
where employee is the name of the secondary data source repeating group (in my case from a sharepoint list), employeeid is one of the fields in the group, and name is one of the other fields.
What I have is this:
In the infopath form's data source information, I have a group called CountryList, and within it, there is a repeating group called group2. Within it are 3 items, AdapterCountry (the name of view 1's dropdown listbox), PhoneAdapterNumber, PowerAdapterNumber. Within my secondary source (the data connection to sharepoint), I have a repeating group called PhonePowerAdapter, with fields called :Country, :Power_Adapter, and :Phone_Adapter.
The control for CountryList is a dropdown listbox inside of a repeating section. This is what I intended to use since I was unable to find a way for a infopath 2007 browser app to support selecting multiple items within a dropdown listbox.
So the user creates one or more of these items within the repeating section. When they hit the submit button, a rule kicks off to select a new view. The new view has fields for the country that was selected from the drop down listbox (type listbox), as well as a field for power adapter and a field for phone adapter. These are also in a repeating section.
My expectation was that since infopath had retrieved the entire sharepoint list when the application started, it was caching, somehow, the ids of the listbox entries that the user selected. So it didn't seem like it was going to be hard to get the values of the other two columns to show up in the appropriate sections of the second view. I mean, the countries are showing up.
I've tried using 3 listboxes, and just telling them to get the information from the external source and display the appropriate columns. But I couldn't figure out how to get the index information to the listboxes. I tried using text controls and doing a filter to set the field from the secondary source, but I didn't know about the current() function so I didn't know how to get to it. I hoped that IP would just generate it appropriately, but so far that hasn't worked.
Thank you for your patience with me on this.