Comparing Field in Repeating Section to List of Values - InfoPath Dev
in

InfoPath Dev

Comparing Field in Repeating Section to List of Values

Last post 06-27-2013 12:41 PM by jt123. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-27-2013 11:39 AM

    • jt123
    • Not Ranked
    • Joined on 06-27-2013
    • Posts 3

    Comparing Field in Repeating Section to List of Values

    Working in InfoPath 2007. I have a form that submits fields from a repeating section to a SharePoint list. Each item from the repeating section has a unique identifier field named "ActionTitle". I want to check if each ActionTitle matches an existing Title field in my SharePoint list. I have imported the Title field from SharePoint then wrote a rule that said "Any Instances of" Title(secondary data source) IS EQUAL TO ActionTitle (a field in the repeating section in my main data source). The rule changes another field in the repeating section called "IsSubmitted" to show TRUE. I want to show if each of my items has been submitted to SharePoint. However, my rule did not work because the "IsSubmitted" field shows TRUE for each item, even if only one ActionTitle matches. Is there a way I can check each instance of ActionTitle separately.
  • 06-27-2013 12:07 PM In reply to

    Re: Comparing Field in Repeating Section to List of Values

    Yes, but you'll have to manually insert the current() function so that it refers to each row specifically.

    To do this, just go back to edit the condition of your rule and change the left dropdown to "The expression...". This will show the xpath for your existing rule on the right. Now, copy that out to notepad. You'll see a long xpath string with square brackets at the end showing [. = blah-blah-blah/my:field].  You want to replace the blah-blah-blah with current() and then copy the string back into the expression and see if that works.

     

    Patrick Halstead
    Project Manager at Qdabra
  • 06-27-2013 12:41 PM In reply to

    • jt123
    • Not Ranked
    • Joined on 06-27-2013
    • Posts 3

    Re: Comparing Field in Repeating Section to List of Values

    Before editing the expressions was:

     xdXDocument:GetDOM("Action Item Title Import")/dfs:myFields/dfs:dataFields/dfs:Action_Items/@Title[. = xdXDocument:get-DOM()/my:meetingAgenda/my:actionItems/my:actionItem/my:actionItemTitle]

    I tried replacing with current(), but I'm not sure I'm putting it in the right place as the function wasn't working.  Where would I insert "current()" in this expression?

     Some additonal info: 

    - my:meetingAgenda is the main group.

    -my:actionItems is a group

    - my:actionItem is a repeating group.  The repeating section contains all the fields within this group

    -my:actionItemTitle is a text field. 

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