cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EcklerAdmin
Level: Powered On

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
Microsoft v-siky-msft
Microsoft

Re: Delegation

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
Super User
Super User

Re: Delegation

@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."

EcklerAdmin
Level: Powered On

Re: Delegation

@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

EcklerAdmin
Level: Powered On

Re: Delegation

@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.
Super User
Super User

Re: Delegation

@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."

Microsoft v-siky-msft
Microsoft

Re: Delegation

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 

EcklerAdmin
Level: Powered On

Re: Delegation

@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

Microsoft v-siky-msft
Microsoft

Re: Delegation

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,823)