Filtering external datasource in repeating table not working - InfoPath Dev
in

InfoPath Dev

Filtering external datasource in repeating table not working

Last post 12-13-2015 07:29 AM by mwitt. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-10-2015 07:52 AM

    • mwitt
    • Not Ranked
    • Joined on 12-10-2015
    • Posts 4

    Filtering external datasource in repeating table not working

     Hi,

    New to this forum, so I post this in the general section and hope you can move it to the correct place.

    I´m not a developer, but are using InfoPath 2013 to enhance some internal business processes, but not doing any coding. I have run in to a tricky problem that I have not been able to solve, even after reading a lot of posts here and in other places.

    I have a form where I use a repeating table with 4 different fields. The same repeating table is also inserted further down in the form as a repeating section where a lot of additional fields are used to populate detailed data.

    In the repeating section I have fields where I try to filter out results from a connected sharepoint list based on values in the repeating table. When I only have one row, it works fine, but as soon as I add additional items, it seems to pick up the values from the firs row only in the filtering rules.

    It seems that I need to use the current () function to reference the individual rows to get the filter to work on each individual repeating row/repeating section, but I cant figure out how to do this.

     

    This is the x-path for the filed that I want to auto-populate based on filtering of the external datasource:

    xdXDocument:GetDOM("SIEM hardware")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Number_x0020_of_x0020_servers[contains(../d:Title, "Index") and ../d:Deployment_x0020_type = xdXDocument:get-DOM()/my:myFields/my:datacenters/my:group2/my:architecture and ../d:deployment_x0020_size_x0020__x00 = xdXDocument:get-DOM()/my:myFields/my:datacenters/my:group2/my:hw_capacity]

    As you can see, I use three different filtering criteria's to identify the correct info.

     

    Hope someone can help out.

    Best regards

    /Micke 

     

  • 12-10-2015 12:04 PM In reply to

    Re: Filtering external datasource in repeating table not working

     What is repeating in your main data source? group2? Where is the formula you posted being used? In a rule or as a default value? I'm asking because I can help you with this - but what the XPath would be depends on where it is used. If, for example, you have a field in group2 that has a default using this, it would be:

     xdXDocument:GetDOM("SIEM hardware")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Number_x0020_of_x0020_servers[contains(../d:Title, "Index") and ../d:Deployment_x0020_type = current()/../my:architecture and ../d:deployment_x0020_size_x0020__x00 = current()/../my:hw_capacity]

    Hilary Stoupa

  • 12-11-2015 12:44 AM In reply to

    • mwitt
    • Not Ranked
    • Joined on 12-10-2015
    • Posts 4

    Re: Filtering external datasource in repeating table not working

     Hi Hilary and thanks for your fast reply. I can not attach the file as it contains sensitive info, but I will try to clarify this better;

     

    I have a repeating table, lets call it table1.

    I table1 I have four columns with fields, lets call them fieldA, fieldB, fieldC and fieldD

    Table1 data is also added as a repeating section further down in the same form, lets call it section1.

    In section1, fieldA, fieldB, fieldC and fieldD is also shown.

    In section1 I also have additional fields, tied to the same repeating data source (table1), lets call this fieldE.

    To populate fieldE, I have an external data source in the form of a sharepoint list, lets call this list1.

    The xpath above is the default value logic applied to fieldE to filter out the correct value form list1 using information from fieldA & fieldB & a static text value.

    What I need to understand is how to reference fieldA and fieldB per row as rows and sections are added by the users.

     

    In the xpath below, fieldE =  Number_x0020_of_x0020_servers

    fieldA =  architecture

    fieldB =  hw_capacity 

    xdXDocument:GetDOM("SIEM hardware")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Number_x0020_of_x0020_servers[contains(../d:Title, "Index") and ../d:Deployment_x0020_type = current()/../my:architecture and ../d:deployment_x0020_size_x0020__x00 = current()/../my:hw_capacity] 

    Best regards

    /Micke  

  • 12-11-2015 08:51 AM In reply to

    Re: Filtering external datasource in repeating table not working

    Sorry, I'm still having a hard time understanding. Did the formula I provided help? "current()" always refers to the current field. So, in a default value using the formula above, to get another field in the same group as the field we've put the default in, we use "current()" to get the current node, "/../" to move back up to the repeating group2, then "my:architecture" to select the architecture node in the same repeating group2 node as the current field.
    Hilary Stoupa

  • 12-13-2015 07:29 AM In reply to

    • mwitt
    • Not Ranked
    • Joined on 12-10-2015
    • Posts 4

    Re: Filtering external datasource in repeating table not working

     Hi Hilary, I think you got it immediately, as you initial suggestion solved my problem:-)!

     Thanks a lot, what I did not get was that I needed to replace the full path.

     

    Best regards

    /Micke 

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