Repeating tables. - InfoPath Dev
in

InfoPath Dev

Repeating tables.

Last post 12-16-2009 02:16 PM by laundrytubman. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-15-2009 10:09 AM

    Repeating tables.

    Hi,

    I have a repeating table that is storing items in it as below.  

    <my:ToolsGrouping>
    <my:ToolBuild>
    <my:Sensor>
    <my:Tool1>10</my:Tool1>
    <my:Software1></my:Software1>
    </my:Sensor>
    <my:Sensor>
    <my:Tool1>20</my:Tool1>
    <my:Software1></my:Software1>
    </my:Sensor><my:Sensor>
    <my:Tool1>30</my:Tool1>
    <my:Software1></my:Software1>
    </my:Sensor>
    </my:ToolBuild>
    </my:ToolsGrouping>

    I then have a rule for the repeating table to output to a field.

    I am using a form library on an sharepoint site. the form is an infopath form, that has a separate datasource to another list on the sharepoint site. I then have a repeating table on the infopath form, that has a dropdown list that is populated by the sharepoint site datasource. Im not going to be able to write out the XML code for the sharepoint site, but lets say its a list with 2 columns, one labeled Tool and the 2nd labeled Request. The repeating table(this is the Tool1 in the datasource example above) on the infopath form is what was selected in the dropdown list that is populated with the Tool column from the sharepoint site list. What i would like, is to have an XPath expression that will output all Request row items that have the Tool row item the same as any of the reapeating table dropdown list (Tool1)

    This is what i currently have as the rule:

    <xsf:rule caption="Tool Specific Requirements" condition=". = xdXDocument:GetDOM(&quot;Tool Specific Requirements&quot;)/dfs:myFields/dfs:dataFields/dfs:Tool_Specific_Requirements/@Tool" isEnabled="yes">
    <xsf:assignmentAction targetField="../../../../my:group4/my:Tool_Specific" expression="xdXDocument:GetDOM(&quot;Tool Specific Requirements&quot;)/dfs:myFields/dfs:dataFields/dfs:Tool_Specific_Requirements/@Requirements[../@Tool = current()]"></xsf:assignmentAction>
    </xsf:rule>

    unfortunately this Xpath rule, only outputs the Requirements that has Tool the same as the specific row in the repeating table.  Each dropdownlist in each row in the repeating table has a different value (as you can see from the xml at the top).  So what would the Xpath be to output all @Requirements that have @Tool the same as any of the "Tool1"

     

    Thanks!!!

     

     

  • 12-16-2009 08:43 AM In reply to

    Any help at all would be great!!  Please?

  • 12-16-2009 09:13 AM In reply to

    I'm afraid I don't quite understand. When you say 'all request row items' do you mean you want them in a concatenated form, like 'item a, item b, item c'? Or do you mean you want to create another repeating table in your main data source that has an instance of the repeating group for each item?

    If you need to copy repeating data from a secondary data source into your main data source and don't want to write code, I'd recommend qRules. If you want to munge them all together in a comma (or some other delimiter) separated list, you should look into using the double eval method, particularly as described in this post.

    Hilary Stoupa

  • 12-16-2009 02:16 PM In reply to

    Wow, thanks for that, that is a ton of information.  I am trying to concatinate the data into one field.  I am still having some isssues with it however.  this is my xpath:

    xdMath:Eval(../../my:ToolsGrouping/my:ToolBuild/my:Sensor, 'concat(xdXDocument:GetDOM("Tool Specific Requirements")/dfs:myFields/dfs:dataFields/dfs:Tool_Specific_Requirements/@Requirements[xdXDocument:get-DOM()/my:myFields/my:ToolsGrouping/my:ToolBuild/my:Sensor/my:Tool1 = ../@Tool], " ")')

    unfortunately, this outputs the same thing as before, it only outputs what the current repeating table Tool1 is.  if i put another eval( infront with , "..") at the end, it basically prints out the same thingx the number of rows in the repeating table. 

    Logically, i would like it to do this: For each Tool1 in Repeating table output Requirements where Tool is = Tool1

    ARGH!  I need an XML course.

     

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.