cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ACPBSCi
Resolver I
Resolver I

Delete row in repeating table on submit

Here's one for you. I have an app that's part form and part repeating table. Table works like a champ. Using the Reset feature to clear my forms works like a champ. However, the data that I enter into the fields of my repeating table does not clear:

1.PNG

I can do a lot of coding to clear those fields, but will that take away the rows, too? The code in the X for each row is:

RemoveIf(UserCollection,UserItemNumber=ThisItem.UserItemNumber)

So if I want all the rows to go away when I click "Save", I would need to

  1. keep a count of all the rows that were added,
  2. write a formula that removes the same number of rows

What would that formula look like? And how would I count the rows?

1 ACCEPTED SOLUTION

Accepted Solutions
GarethPrisk
Super User II
Super User II

RemoveIf can match and remove multiple rows, if the filter criteria works.

To clear the whole collection (all rows), use the Clear function Clear(UserCollection);

To count the rows beforehand, just CountRows(UserCollection) as a separate function before clearing.

View solution in original post

2 REPLIES 2
GarethPrisk
Super User II
Super User II

RemoveIf can match and remove multiple rows, if the filter criteria works.

To clear the whole collection (all rows), use the Clear function Clear(UserCollection);

To count the rows beforehand, just CountRows(UserCollection) as a separate function before clearing.

View solution in original post

Clear(Collection) worked! That's good to know. I was afraid having a repeating table would make it so complicated. I was definitely overthinking it. Thank you so much @GarethPrisk!!! That was the last hurdle on the first app I've ever built.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,750)