You searched for the word(s): 12
-
concat("Delete /xpath=my:myFields/my:Rooming/my:HotelGroup/my:HotelRepeatingSection[", count(preceding-sibling::HotelRepeatingSection) + 1, "]/my:RoomingGroup/my:RoomingTable[", count(preceding-sibling::RoomingTable) + 1, "]")
-
Aha! Yes, you're correct. Any ideas on how I sneak that second filter in there? I tried this, and it didn't work -
concat("Delete /xpath=my:myFields/my:Rooming/my:HotelGroup/my:HotelRepeatingSection/my:RoomingGroup/my:RoomingTable[", count(preceding-sibling::RoomingTable) + 1, ...
-
Yes - you'll need to move back up the tree - you are on RoomingTable, so it would be something like ../../preceding-sibling::my:HotelRepeatingSection for the XPath in your count formula (may be one more ../ in there)
-
I'm trying it now, just not sure where to insert it into the formula. Keep in mind this button resides within the RoomingTable. So whenever I try to count - I get this error - "preceding-sibling::myHotelRepeatingSection" does not point to a valid location path of a field or group.
-
I think you'd need to specify your HotelRepeatingSection as well - have you tried that?
-
I get it. Here's what worked for me -
concat("Insert /parent=/my:myFields/my:Rooming/my:HotelGroup/my:HotelRepeatingSection[", count(preceding-sibling::HotelRepeatingSection) + 1, "]/my:RoomingGroup ...
-
As I said, you can use the concat function to indicate which of the repeating parent groups should have this inserted. If this is a client form, you could use the position function. If this a browser form, you could use a count of preceding-siblings (this is assuming that the rule to insert the child repeating group is on the parent).
-
That works great for the second section. But what about the 3rd, 4th, etc? Can the current() function be inserted in here somewhere?
I may just have to use the built in Infopath add and remove controls on this repeating table.
-
Yes, GetInputParameters works in the browser - be sure to set your rule on the Qdabra Rules data source finishedLoading node (finishedLoading = true). Since rules run before code, you want to use the finishedLoading node for running qRules commands on form open.
-
There's an alternate syntax if you want to add a filter - xpathsrc.
So, your command would be something like:
Insert /parent=/my:myFields/my:Rooming/my:HotelGroup/my:HotelRepeatingSection[2]/my:RoomingGroup /xpathsrc=/my:myFields/my:Rooming/my:HotelGroup/my:HotelRepeatingSection/my:RoomingGroup/my:RoomingTable
You can use a concat formula ...