How to remove initial row in repeating tables (or delete all rows) with rules only
Special thanks: Karl D. Swartzendruber
First of all you have to place your repeating group into the non repeating one. So your field structure should be looking like that:
Then as you can see the simple rule f=cleaningGroup will delete all rows. Now we are getting to the point why it never been implemented before. As soon as you will try to assign any value to a group InfoPath will yell at you with the message: “You must select a field. Groups do not have values and therefore cannot be assigned to by this action.” Let’s prove that at least “cannot be assigned” part of that statement is false.
It’s time for some rule breaking.
Now we will screw up the group (“f” in our case) by giving it a temporary name. Create a field at the same level as your group formerly named “f”. Name that field … guess what? Right, with the name “f”. Now InfoPath UI won’t be objecting when you’ll try to create button rule f=cleaningGroup. Delete field “f”. Rename your group back to its original name: “f”.
The Form to test. Web browser forms OK.
Deleting single row from the repeating field.
Here is form
that is doing exactly this. The way it was created (renaiming hack) is similar to the previous form. There are several limitations assosioated with this approach. First is it supports single repeating field not repeating group. Another “feature” you have to consider before you decide to use this form is unchecking checkbox at single row will delete all rows with the same value (might be useful in certain scenarios). Also because of Multiple selection check box this form can be made browser enabled in SP2010 only.
You rock. This is awesome!
Ignacio - May 6, 2010 at 8:31 pm |
The solution rocks. It really does.
Nazer Mohamed - September 13, 2010 at 11:10 am |
Awesome! So simple, but it works perfectly!
Toby - September 16, 2010 at 10:22 pm |
Is there a way to only remove a single row instead of all rows? I know the default functions allows for this, but I am trying to remove all of that and simplify the end user experience
Larry - July 21, 2011 at 2:47 pm |
No. I don’t think it’s possible.
alecpojidaev - July 21, 2011 at 6:19 pm |
is there a way to select a specific row(s). and delete? maybe a button in a column, clickuing deletes that row, or a checkbox and the selcted rows delete with a button click? can anything close to this be achieved?
Larry - July 26, 2011 at 2:48 pm
I don’t think it’s possible.
alecpojidaev - July 26, 2011 at 6:04 pm
you r great great great. you solved my major issue.
rajkumarbathulaaj - March 5, 2012 at 7:00 am |
Instead of adding and renaming, you can select any input field like name = ” cleaningGroup “, then open your manifest file in xml editor and search by your rule name and rename your name filed with ” f “. For verification open your rule and will see ” f = cleaningGroup “. Cheers :)))
Ather Usmani - March 21, 2012 at 2:36 pm |