
Announcements
I have 2 different Galleries looking at 2 different Dataverse Tables, and using a SortByColumns in each formula.
I am actually using a Lookup Formula to state the "sort column" (I know the documentation says it should be a text literal, but the documentation is wrong - a formula works fine, as long as the formula returns a string).
For one Dataverse Table (Companies), I am NOT getting a delegation warning.
But for the other Dataverse table (Quotes), I AM getting a delegation warning.
The Companies Table is heavily filtered with quite a large formula, but the Quotes filter is pretty simple.
Is the PowerApps studio engine simply not stating the delgation warnings correctly?
Perhaps when the filter is a complicated function, it bypasses the delgation warning checks?
My conundrum is - Can I trust the Delegation warnings?
Am I going to get partial datasets of Companies without knowing it?
I have included my code snippets below:
Companies Gallery Items:
SortByColumns(
Filter(
If(IsBlank(Txt_CustomerSearch.Text),
If(Choice_My_All.Selected="MY Customers",
Filter(Companies,
'UK Sales Rep'.'Full Name'=str_UserName
&& ('Company Type'=str_SelectedFilter_CompanyType || str_SelectedFilter_CompanyType="ALL")
&& ('Country / Region' in Combo_Filter_Country.SelectedItems.sdx_option || IsBlank(Combo_Filter_Country.Selected.sdx_option))
),
Filter(Companies,
('Company Type'=str_SelectedFilter_CompanyType || str_SelectedFilter_CompanyType="ALL")
&& ('Country / Region' in Combo_Filter_Country.SelectedItems.sdx_option || IsBlank(Combo_Filter_Country.Selected.sdx_option))
)
),
Search(Companies,
Txt_CustomerSearch.Text,
"sdx_name","sdx_aka","sdx_customerreference","sdx_contacttelephone"
)
),IsBlank('Parent Company')),
Coalesce(LookUp(col_ColumnReference_Companies,DisplayName=Gallery_Customers_Headers.Selected,LogicalName),"sdx_name"),
If(Gallery_Customers_Headers.Reverse,Descending,Ascending)
)
Quotes Gallery Items:
SortByColumns(
Quotes,
LookUp(col_ColumnReference_Activities,DisplayName=Gallery_SimpleQuote_Headers.Selected,LogicalName),
If(Gallery_SimpleQuote_Headers.Reverse,Descending,Ascending)
)(Delegation Warning on the "LookUp" formula for the sort column)
James.
So - Things are even more interesting than I thought...
... I ran the App in a Monitor session (with "Debug Published App" turned on), and things are even more Curious!
In the App Monitor - I get a Delegation Warning (and a warning that only 2000 records were scanned) for the Companies query, but NOT the quotes query! (And there are over 10,000 records in each table)
So -
Companies Table Query - PowerApps Studio does NOT give a delegation warning, but the monitor DOES.
Quotes Table Query - PowerApps Studio says Delegation Warning, but Monitor does NOT
I'm inclined to believe the Monitor over the PowerApps Studio
There's a Lesson here:
DO NOT TRUST THE POWERAPPS STUDIO TO GIVE YOU A DELEGATION WARNING.
IT LIES!
James.