problem with rule in repeating table/section - InfoPath Dev
in

InfoPath Dev

problem with rule in repeating table/section

Last post 11-21-2012 07:07 AM by roland_s. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-21-2012 12:12 AM

    problem with rule in repeating table/section

    Hi everybody,

    situation as follows: i have a sharepoint list with two columns, one with country names, the second one with the according abbreviation. So e.g. one line says "United Kingdom" in the country column, and "UK" in the abbreviation column.

    Now i got a dropdown in infopath, filled with the country names by adding a secondary data connection and an ordinary textbox, which is filled with the appropriate abbreviation by rule, when a country is selected in the dropdown.

    This Rule looks like this (i hope i get it translated correctly, i'm using the german version of infopath):

    Action rule "Set a field's value": field_abbr = "SharePointListItem_RW - abbreviation" [field_country="SharePointListItem_RW - title"]

    So far, so good. But when i use this rule in a repeating table, it doesn't work any more, because at some point, the abbreviation field of the second line is filled with a value which refers to the first line of the table. Which makes quite sense, given the way the rule is defined. But nevertheless i need a solution for a reapting table and don't know how to do it.

    My goal is, that i can add as many lines as i want in the table (each line has then of course a dropdown with countrynames and a textbox for the abbreviation) select a different country in every line and get the abbreviation right in every line.

    Any help would be greatly appreciated.

    Regards 

    Roland

  • 11-21-2012 05:20 AM In reply to

    Re: problem with rule in repeating table/section

    I think you're on the right path. I'm assuming field_country is the node in the main data source. If so, try using current() instead. This means InfoPath will use the current value of the node you're on (that is, the dropdown) as the filter in your rule.

    Let us know if this works!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 11-21-2012 07:07 AM In reply to

    Re: problem with rule in repeating table/section

    Hey, 

    works perfekt, just replaced the term in the xpath:

    xdXDocument:GetDOM("list_countries")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Abbreviation[current() = ../d:Title]

    thank you, really appreciate it!

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