cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Remove Function is Delegable?

Hi, 

I test the delegation for "Remove" function. 

My data table has around 100 records.

I reduced data row limit from 2000 to just 2 for a sake of this test. 

 

When I remove some selected records (located in row > 2 in the data table) from a filtered gallery table, it still deletes properly.

 

I'm still learning delegation and would like to make my app to be all delegable. 

So I wonder why the Remove function is still working properly while I have reduced the row limit to just 2? While on the other hand Microsoft doc mentioned that Remove and RemoveIf is not delegable. 

 

Appreciate the help, thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @HeihoSilver ,

Delegable or not, Remove would always work in your example as you are only deleting one record.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

3 REPLIES 3
Super User III
Super User III

@HeihoSilver ,

My understanding is that Remove() is Delegable, but certainly RemoveIf() is not - what code did you use on your test function?

I have done a blog on Delegation that may be of assistance to you.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

@WarrenBelz Thank you for the swift response and the blog, it will be useful for me later. 

 

Here is the Remove doc reference which mention these functions (Remove and RemoveIf) are not delegable. 
However, Delegation doc only mentioned RemoveIf to be non delegable. 

I use Sharepoint as a data source. Here is the example of my code:

//Gallery example
Sort(Filter(Table, ColumnX = Blank(), ColumnY = 5), ColumnA)

//Remove function is simply:
Remove(Table, Gallery.Selected)


Actually I also do some tests for the ClearCollect just to understand the concept of "Delegable" and "Data row limit for non-delegable queries" (e.g. 500 by default). In this case I put the row limit to be just 2.

ClearCollect(_UserTable, Filter(User, UserAccessType = "Edit"));
ClearCollect(_UserTable2, Filter(User, UserAccessType = "Edit" And (ID = 50 Or ID = 75 Or ID = 25)));

The _UserTable shows the first 2 results with UserAccessType: Edit (data in row 1 and row 2)
The _UserTable2 shows the first 2 results with UserAccessType: Edit and ID = 25 or ID = 50. (data in row 25 and row 50). Row 75 is not shown because I set the row limit to only 2. 

 

Based on this test, it is quite clear that the non delegable (ClearCollect) is still working with filter applied as long as the limit is still within the data row limit.

It shows also that the non delegable function with filter does not retrieve the first 2 rows, but the first 2 scanned filters. So I think, in this case if I have the data in row 5000 (ID = 5000), it will still be retrieved anyway in the filtered ClearCollect above. e.g. 
ClearCollect(_UserTable2, Filter(User, UserAccessType = "Edit" And (ID = 50 Or ID = 5000)));
But I haven't tested it yet since I don't have that data. 

 

Hi @HeihoSilver ,

Delegable or not, Remove would always work in your example as you are only deleting one record.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (17,106)