Hello Experts,
I have a gallery named Gallery_jobReports, I have placed an Icon beside every name of the column to sort each column. Also I have five checkboxes to filter my data. To filter I have placed five text labels and set its text property to : If(Checkbox4_5.Value = true, Checkbox4_5.Text) this way I get the value of check box into the label which is not visible, so when the user checks any box the data gets filtered. The Items property I have set as below
Switch(
locSortColumn,
"Title",
Sort(
If(
IsBlank(Label28.Text) && IsBlank(Label29.Text) && IsBlank(Label30.Text) && IsBlank(Label31.Text) && IsBlank(Label32.Text),'SU_Job_List',
Filter(
'SU_Job_List',
StartsWith(
Brand,
Label28.Text
) || StartsWith(
Brand,
Label29.Text
) || StartsWith(
Brand,
Label30.Text
) || StartsWith(
Brand,
Label31.Text
) || StartsWith(
Brand,
Label31.Text
)
)
),
Title,
If(
locSortAscending,
SortOrder.Ascending,
SortOrder.Descending
)
),
"Project",
Sort(
If(
IsBlank(Label28.Text) && IsBlank(Label29.Text) && IsBlank(Label30.Text) && IsBlank(Label31.Text) && IsBlank(Label32.Text),'SU_Job_List',
Filter(
'SU_Job_List',
StartsWith(
Brand,
Label28.Text
) || StartsWith(
Brand,
Label29.Text
) || StartsWith(
Brand,
Label30.Text
) || StartsWith(
Brand,
Label31.Text
) || StartsWith(
Brand,
Label32.Text
)
)
),
Project,
If(
locSortAscending,
SortOrder.Ascending,
SortOrder.Descending
)
),
"Episode",
Sort(
If(
IsBlank(Label28.Text) && IsBlank(Label29.Text) && IsBlank(Label30.Text) && IsBlank(Label31.Text) && IsBlank(Label32.Text),'SU_Job_List',
Filter(
'SU_Job_List',
StartsWith(
Brand,
Label28.Text
) || StartsWith(
Brand,
Label29.Text
) || StartsWith(
Brand,
Label30.Text
) || StartsWith(
Brand,
Label31.Text
) || StartsWith(
Brand,
Label32.Text
)
)
),
Episode,
If(
locSortAscending,
SortOrder.Ascending,
SortOrder.Descending
)
),
"Photographer",
Sort(
If(
IsBlank(Label28.Text) && IsBlank(Label29.Text) && IsBlank(Label30.Text) && IsBlank(Label31.Text) && IsBlank(Label32.Text),'SU_Job_List',
Filter(
'SU_Job_List',
StartsWith(
Brand,
Label28.Text
) || StartsWith(
Brand,
Label29.Text
) || StartsWith(
Brand,
Label30.Text
) || StartsWith(
Brand,
Label31.Text
) || StartsWith(
Brand,
Label32.Text
)
)
),
Photographer,
If(
locSortAscending,
SortOrder.Ascending,
SortOrder.Descending
)
),
"Shoot Date",
Sort(
If(
IsBlank(Label28.Text) && IsBlank(Label29.Text) && IsBlank(Label30.Text) && IsBlank(Label31.Text) && IsBlank(Label32.Text),'SU_Job_List',
Filter(
'SU_Job_List',
StartsWith(
Brand,
Label20.Text
) || StartsWith(
Brand,
Label21.Text
) || StartsWith(
Brand,
Label22.Text
) || StartsWith(
Brand,
Label23.Text
) || StartsWith(
Brand,
Label24.Text
)
)
),
'Shoot Date',
If(
locSortAscending,
SortOrder.Ascending,
SortOrder.Descending
)
),
"Brand",
Sort(
If(
IsBlank(Label28.Text) && IsBlank(Label29.Text) && IsBlank(Label30.Text) && IsBlank(Label31.Text) && IsBlank(Label32.Text),'SU_Job_List',
Filter(
'SU_Job_List',
StartsWith(
Brand,
Label28.Text
) || StartsWith(
Brand,
Label29.Text
) || StartsWith(
Brand,
Label30.Text
) || StartsWith(
Brand,
Label31.Text
) || StartsWith(
Brand,
Label32.Text
)
)
),
Brand,
If(
locSortAscending,
SortOrder.Ascending,
SortOrder.Descending
)
),
'SU_Job_List'
)
The error I am getting is -
Thanks.
Below are the screenshots of my screen for your reference.
@walaa96 ,
You need to check all of the things I mentioned
@WarrenBelz , @muzamil-baxture
Thanks for your quick support, Num_of_Inv is a label inside the gallery that I want to filter by the checkbox, if the user clicks it the gallery will return only the values that >0, and the CheckboxNum is outside the gallery. I'm a little bit confused.
I committed the mistake that I placed one of the controls inside a gallery, that's what gave me this error. Please check all your controls are outside the gallery. That would solve your issue.
@walaa96 ,
The first place to look if the Default of any of these controls refers to the gallery and also confirm that none are in the gallery
I wrote the formula on the gallery items property:
Filter(
Customers_Data_Automate,
(OU_Name = OU_Login.Selected.Result)
&& (Customer_Name = cbCustomers.Selected.Customer_Name || cbCustomers.Selected.Customer_Name = Blank())
&& If(CheckboxNum.Value, Value(Num_of_Inv.Text)>0, true))
I have the same scenario with the same error, I tried to rename the checkbox or check the formula, it showed like this I didn't get it:
Appreciate your support.
Many thanks,
@BCBuizer , I tried your given formula and its working perfectly fine.
I also tried @WarrenBelz , solution its also working fine but I have delegation issue.
I really appreciate for your reply's @Drrickryp.
@RezaDorrani has a very nice video showing how sort and filter columns like you have in your screenshot. https://www.youtube.com/watch?v=6KlI1iZ_KD0
HI @muzamil-baxture ,
As per the PM you sent, I agree with @BCBuizer that there is nothing there that should cause a circular reference unless one of your labels or check boxes, or sort order Variable refers to the gallery or something inside it. I have broken it down bit more and suggest you get rid of those calculated labels as they are prone to calculation order/priority issues, rename your check boxes as below and try this
SortByColumns(
Filter(
'SU_Job_List',
(
!ckABC.Value ||
Brand = "ABC Entertainment"
) &&
(
!ckHulu.Value ||
Brand = "Hulu"
) &&
(
!ckEpisode.Value ||
Brand = "Episode"
) &&
(
!ckPhotographer.Value ||
Brand = "Photographer"
) &&
(
!ckShootDate.Value ||
Brand = "Shoot Date"
)
),
locSortColumn,
If(
locSortAscending,
SortOrder.Ascending,
SortOrder.Descending
)
)
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.
MVP (Business Applications) Visit my blog Practical Power Apps
Hi @muzamil-baxture ,
After simplifying your formula a bit, there's nothing in there that makes a circular reference stand out:
Sort(
If(
IsBlank(Label28.Text) && IsBlank(Label29.Text) && IsBlank(Label30.Text) && IsBlank(Label31.Text) && IsBlank(Label32.Text),'SU_Job_List',
Filter(
'SU_Job_List',
StartsWith(
Brand,
Label28.Text
) || StartsWith(
Brand,
Label29.Text
) || StartsWith(
Brand,
Label30.Text
) || StartsWith(
Brand,
Label31.Text
) || StartsWith(
Brand,
Label31.Text
)
)
),
Switch(
locSortColumn,
"Title", Title,
"Project", Project,
"Episode", Episode,
"Photographer", Photographer
"Shoot Date", 'Shoot Date',
"Brand", Brand
),
If(
locSortAscending,
SortOrder.Ascending,
SortOrder.Descending
)
)
This makes me think this formula is perhaps not the one causing the circular reference.
Can you check the error details to see what control / property is causing the issue:
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 2