I am sure this has been solved numerous times, I just can't find the solution I want
Consequently I have implemented a work around based on my web searching, which I now offer to others in the hope that someone (Hilary :-) ) will finalise what I want to do.
I have a simple form with a single 3 column Repeating Table - Name, DateOfJoining and Age (as a simple example). Once a number of rows have been entered the resulting SharePoint List concatenates the fields - so Name now consists of all the Names, DateOfJoining all the entries, etc. Other items in the List also have the same structure.
If I want to extract the last entry (the last person to join), I have usually exported the list to Excel, used Text-to-Column and removed the surplus data manually - NOT the ideal solution.
The work-around I have now used is to add a text field for each column in the Repeating Table I want to include in a report and then used a function to copy the last entry into the text field so that when the form is saved the last Repeating Table entry is available via the textbox contents.
The function is based on Alec Pojidaev's original blog http://alecpojidaev.wordpress.com/2010/01/07/accessing-previous-rows-in-repeating-group-for-browser-enabled-forms/
/my:myFields/my:Details/my:Table[count(following-sibling::*[local-name() = "Table"]) = 0]/my:Name - where Name is one of the field names I want to copy. Change this to DateOfJoining and Age for the other text boxes
save the fields in the SharePoint List and I have access to the relevant data. I don;t want to use the date as the differeniator as in other tables it will not be a numeric or date data type.
Now the challenging bit - for me at least
Eventually I want to add the SharePoint List to a new form as a Secondary Source, which I have already done and can see all the relevant fields, but I cannot change the above function to extract the last entry in each field
the XPath for the Secondary Source is - /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Name so I guessed it was a matter of substituting the relevant myFields etc from one XPath to the other???
didn't work though - hence this posting
So essentially what I would like to do with OOTB infopath 2010 is to include a Secondary Source which is a SharePoint List which includes a Repeating Table and extract only the last field of certain nodes within the Repeating Table.