Question about qRules Insert command - InfoPath Dev
in

InfoPath Dev

Question about qRules Insert command

Last post 04-02-2015 10:56 AM by ShaneHarvy. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-26-2015 01:14 PM

    Question about qRules Insert command

    I am using the Insert command to insert a row into a nested repeating table using "Insert /parent=/my:myCPR/my:MainPageGroup/my:MeetingInfoSection/my:Meetings/my:Meeting/my:Clients /child=my:Client" The "my:Meeting" is the first repeating group and nested inside that group is the repeating group "Client". When activating the insert command (by button) in the first instance of "Meeting", it works as expected, but in the second instance of "Meeting", when I use the button to insert, it inserts into the repeating section for the first instance of "Meeting". Did I make a mistake in the command? (Or am I just not thinking about it right)? I can attach .xsn if needed. Thank you!
  • 03-26-2015 02:07 PM In reply to

    Re: Question about qRules Insert command

    Hi, Shane!

    You'll need to use a concat command for this - where is the button located? In a section bound to "Meeting"?

    If so:

    concat("Insert /parent=/my:myCPR/my:MainPageGroup/my:MeetingInfoSection/my:Meetings/my:Meeting[", count(preceding-sibling::my:Meeting) + 1,"]/my:Clients /child=my:Client")

    Hilary Stoupa

  • 04-02-2015 10:30 AM In reply to

    Re: Question about qRules Insert command

    Thanks! This one works great for the first "Meeting" group node, but when I try in the second node, qRules throws the following error. Command: Insert /parent=/my:myCPR/my:MainPageGroup/my:MeetingInfoSection/my:Meetings/my:Meeting[2]/my:Clients /child=my:Client Error: Failed to select the source node. Maybe I have the button in the wrong place? (I am using a picture button placed in the header of the repeating table "Client"
  • 04-02-2015 10:47 AM In reply to

    Re: Question about qRules Insert command

    I'm sorry, I totally spaced on that one - if the /parent param has a filter, you have to use /xpathsrc instead of /child.

    concat("Insert /parent=/my:myCPR/my:MainPageGroup/my:MeetingInfoSection/my:Meetings/my:Meeting[", count(preceding-sibling::my:Meeting) + 1,"]/my:Clients /xpathsrc=/my:myCPR/my:MainPageGroup/my:MeetingInfoSection/my:Meetings/my:Meeting/my:Clients/my:Client")

    Hilary Stoupa

  • 04-02-2015 10:56 AM In reply to

    Re: Question about qRules Insert command

    Perfect. This works like a charm! Thank you so much!
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.