cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Johany_Navarro
Helper I
Helper I

Delegation Warnings... Filtering SharePoint list by Combo Boxes, range of dates also blank date field

Hope you all are ok.

 

I've been trying to avoid delegation warnings on my filter function for this app, I have this formula that works well thanks to @RezaDorrani 

 

Filter(
    'SharePointList',
	//FILTERING BY COMBO BOX
    IsBlank(cbCompanyName.Selected.Result) || IsEmpty(cbCompanyName.SelectedItems) || Title = cbCompanyName.Selected.Result,
	// FILTERING BY RANGE OF DATES
    IsBlank(DatePicker_From) || IsBlank(DatePicker_To) || SharePointListDateColumn >= DatePicker_From.SelectedDate && SharePointListDateColumn <= DatePicker_To.SelectedDate,
    // FILTERING BY RADIO BUTTONS
	IsBlank(rbYesOrNo.Selected.Value) || SharePointListTextColumn = rbYesOrNo.Selected.Value
)//Filter

 

besides, I also need to filter when a date field is empty, I'm doing this by using a boolean variable however as soon as I write the If() within the Filter() I get a delegation warning, I'm using checkboxes to make true or false the variables, see below code and screenshot.

 

Filter(
    'SharePointList',
	//FILTERING BY COMBO BOX
    IsBlank(cbCompanyName.Selected.Result) || IsEmpty(cbCompanyName.SelectedItems) || Title = cbCompanyName.Selected.Result,
	// FILTERING BY RANGE OF DATES
    IsBlank(DatePicker_From) || IsBlank(DatePicker_To) || SharePointListDateColumn >= DatePicker_From.SelectedDate && SharePointListDateColumn <= DatePicker_To.SelectedDate,
    // FILTERING BY RADIO BUTTONS
	IsBlank(rbYesOrNo.Selected.Value) || SharePointListTextColumn = rbYesOrNo.Selected.Value,
	//FILTERING BY BLANK DATES
	If(
        varSharePointDateColumn,
        SharePointListDateColumn = Blank(),
        true
    )
)//Filter

 

 

Johany_Navarro_2-1617634659003.png

also, I need to add another logical test that depends on what's selected in this combo box.

 

Johany_Navarro_1-1617634264724.png

This is my final Filter() formula.

 

Filter(
    'SharePointList',
	//FILTERING BY COMBO BOX
    IsBlank(cbCompanyName.Selected.Result) || IsEmpty(cbCompanyName.SelectedItems) || Title = cbCompanyName.Selected.Result,
	// FILTERING BY RANGE OF DATES
    IsBlank(DatePicker_From) || IsBlank(DatePicker_To) || SharePointListDateColumn >= DatePicker_From.SelectedDate && SharePointListDateColumn <= DatePicker_To.SelectedDate,
    // FILTERING BY RADIO BUTTONS
	IsBlank(rbYesOrNo.Selected.Value) || SharePointListTextColumn = rbYesOrNo.Selected.Value,
	//FILTERING BY BLANK DATES
	If(
        varSharePointDateColumn,
        SharePointListDateColumn = Blank(),
        true
    ),
    If(
        IsBlank(cbPresetReports.Selected.Value) || IsBlank(cbPresetReports.SelectedItems),
        true,
        cbPresetReports.Selected.Value = "Report1",
        Value(SharePointDateColumn) <> 0 && IsBlank(PersonInCharge),
        cbPresetReports.Selected.Value = "Report2",
        Value(SharePointDateColumn_1) <> 0 && IsBlank(SharePointDateColumn_2),
        cbPresetReports.Selected.Value = "Report3",
        Value(SharePointDateColumn_3) <> 0 && IsBlank(SharePointDateColumn_4),
        cbPresetReports.Selected.Value = "Report4",
        Value(SharePointDateColumn_5) <> 0 && IsBlank(SharePointDateColumn_6)
    )
)//Filter

 

I've been searching for the correct formula for a couple of months without any success.

 

Hope one of the Power Apps legends could help me.

 

@RezaDorrani  @aprildunnam  @RandyHayes  @WarrenBelz 

10 REPLIES 10

I haven't given up yet, will keep on trying it, many thanks for your time.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,557)