Goal: Pull data from a SharePoint 2010 List using a WEB ENABLED form. Then, from the repeating table that contains the secondary data, extract only the desired data and mirror it in my main form fields. The extracted data would then be modified, and submitted to another sharepoint list using Nintex Workflows or, if the IT department smiles upon this project, a database.
Original post on Stack Overflow: http://stackoverflow.com/q/19296786/653479
What I've Tried: Created a field, named "TEST_CyS", in a repeating group, named "TEST", in my main form fields to store the mirrored data. This field has a default value of:
xdXDocument:GetDOM("REMOVED")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[(count(../preceding-sibling::*[local-name() = "TEST"]) + 1)]/d:Cy_Statement
This is refreshed when the form updates.
- If I set the default value to count(../preceding-sibling::*[local-name() = "TEST"]) + 1 it accurately counts each inserted group.
- If I set the default value to xdXDocument:GetDOM("REMOVED")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[<INT>])]/d:Cy_Statement where `<INT>` is any whole value between 1 and n then the field will display the correct information, for the secondary data field whose index is referenced.
It's when I combine the two that things fall apart.
Main Data Tree:

Secondary Data Tree:

Assumptions: I am guessing that the preceding-sibling::*[local-name() = "TEST"] axis is not returning a value due to the fact that it's being called along with the GetDOM() method. I've tried to point the preceding-sibling back to the correct group in the Main form fields, but then I felt silly for trying that as it wouldn't know where to start counting AND infopath presented me with an error:
Function 'GetDOM' did not return a value, or it returned a value that cannot be converted to an XSL data type.
Additional Information: I don't have access to VSTA or any third party "plugins". The IT department has the systems locked down so I am working with quite a few barriers. I'd like to create an elegant solution for this project and I know it would be easier if I could use code, but I can't and might not ever be able to on this project.
Is there an alternative method I could use to pull this off or is it a lost cause?
I'm okay with it being a lost cause for right now as it might light some tiny fires under the right managers to press IT. For now I'll be working around this problem by making a less than ideal solution, but I'd like to keep looking at a solution if one might exist.
Thanks!