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

Delegation

So.....answer me a question....i'm using the following code...

 

SortByColumns(Filter(List_DailyWorksheet,Tech=varUserName && SerialDate >= varSerialDate),"Date2","SerialDate")
 
I get a delegation warning on my SortByColumns "Serial Date"
 
Does this mean....that, as long as my Filter pulls less than 500 records I will not have a problem with the Sort?  
 
Thanks for the advice.
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @EcklerAdmin ,

 

I figure out why there is a delegation warning on your formula. Please check this screenshot.Snipaste_2019-12-31_16-13-31.png

that should be a order parameter, if you want to sort by two columns, please modify your formula as below:

SortByColumns(Filter(List_DailyWorksheet,Tech=varUserName && SerialDate >= varSerialDate),"SerialDate",SortOrder.Ascending,"Date2",SortOrder.Ascending)

Sik

View solution in original post

7 REPLIES 7
mdevaney
Super User III
Super User III

@EcklerAdmin 

Unfortunately, NO it does not mean "as long as my Filter pulls less than 500 records I will not have a problem with the Sort"

SortByColumns(Filter(List_DailyWorksheet,Tech=varUserName && SerialDate >= varSerialDate),"Date2","SerialDate")

 

But if you do it this way, then YES 🙂

Filter(SortByColumns(List_DailyWorksheet,"Date2","SerialDate"),Tech=varUserName && SerialDate >= varSerialDate)

 

This is because SORTBYCOLUMNS can be delegated but Date filters in the FILTER function cannot.  Order of operations matters!

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@mdevaney --  i'm not trying to be argumentative here---I've tested after I posted my question and got exactly what I was looking for.  
My list is 946 items

My Delegation threshold is 500.

The items pulled are the newest items entered into the list.


When I use your code, I get 0 results and still the delegation warning.

 

Untitled.png

@mdevaney tbh...the point is mute...the "Serial Date" is the Excel version of Date and Time, so I don't really need the "Date2"-which is a date column....and I get the exact results I need without delegation...

SortByColumns(Filter(List_DailyWorksheet,Tech=varUserName && SerialDate >= varSerialDate),"SerialDate")
 
NOW....I still am interested in why I get correct answers when I shouldn't be.
IF i set my Default View of the Sharepoint list to Sort Date2 from Newest to Oldest, is that the same way that Powerapps gets the data?  If so, that would explain everything ....anyway......thanks for the help.

@EcklerAdmin 

Oh, wait a minute, hahaha.  Both SORT and FILTER use date columns.  They are both cannot be delegated for this reason.  Sorry for the confusion.

 

See this link here:

https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

v-siky-msft
Community Support
Community Support

Hi @EcklerAdmin ,

 

What is the date source? SharePoint list? And Serial Date column is Date and time type, right?

The date column is delegable to the SortByColumns function, however it isn't delegable to Filter function.

So you can only get 500 records from the list, and filter based on these 500 records, then sort based on the filtered records.

By the way, the 500  records you get are taken by ID column In ascending order.

Sik 

@v-siky-msft 
again...not to be argumentative.....My sharepoint list has over 900 items in it.  I just created a new item- I even made a job descrip with your name in it just to be sure--- and sure as day, it show up in my gallery.  I've also added the Date/Time column back to my SortByColumns to add the delegation error back into the equation..  

If Items are pulled in Ascending order, based on ID--which i put in the gallery for us to see....how is my result possible?

Untitled.png

Hi @EcklerAdmin ,

 

I figure out why there is a delegation warning on your formula. Please check this screenshot.Snipaste_2019-12-31_16-13-31.png

that should be a order parameter, if you want to sort by two columns, please modify your formula as below:

SortByColumns(Filter(List_DailyWorksheet,Tech=varUserName && SerialDate >= varSerialDate),"SerialDate",SortOrder.Ascending,"Date2",SortOrder.Ascending)

Sik

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (88,950)