cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter Gallery with Checkbox

Hi All,

 

I am struggling with a filter issue within a gallery. I have a radio selection and search box, which allow the user to filter by OrderStatus, and further search by text (eg id, location etc). Every record is either a "VOR" or "Confirmation" request.

 

What I am after is a checkbox, which when checked, shows only VOR requests in the galley, but also applies the above filtering. Can anyone advise how to do this; I suspect its something simple which I've missed, but I can't get anything to work.

 

My code is below.

 

Thanks,

 

Chris

------

SortByColumns(If

(Radio1_1.Selected.Value="New",Filter(Orders,StartsWith(Title,TextInput2_26.Text)||StartsWith(Requester,TextInput2_26.Text)||StartsWith(FleetNu,TextInput2_26.Text)||StartsWith(OrderRefDup,TextInput2_26.Text)||StartsWith('Created By'.DisplayName,TextInput2_26.Text),OrderStatus="New"),

Radio1_1.Selected.Value="PO Created",Filter(Orders,StartsWith(Title,TextInput2_26.Text)||StartsWith(Requester,TextInput2_26.Text)||StartsWith(FleetNu,TextInput2_26.Text)||StartsWith(OrderRefDup,TextInput2_26.Text)||StartsWith('Created By'.DisplayName,TextInput2_26.Text),OrderStatus="Purchase Order Created"),

Radio1_1.Selected.Value="On Hold",Filter(Orders,StartsWith(Title,TextInput2_26.Text)||StartsWith(Requester,TextInput2_26.Text)||StartsWith(FleetNu,TextInput2_26.Text)||StartsWith(OrderRefDup,TextInput2_26.Text)||StartsWith('Created By'.DisplayName,TextInput2_26.Text),OrderStatus="On Hold"),

Radio1_1.Selected.Value="In Progress",Filter(Orders,StartsWith(Title,TextInput2_26.Text)||StartsWith(Requester,TextInput2_26.Text)||StartsWith(FleetNu,TextInput2_26.Text)||StartsWith(OrderRefDup,TextInput2_26.Text)||StartsWith('Created By'.DisplayName,TextInput2_26.Text),OrderStatus="In Progress"),

Radio1_1.Selected.Value="Cancelled",Filter(Orders,StartsWith(Title,TextInput2_26.Text)||StartsWith(Requester,TextInput2_26.Text)||StartsWith(FleetNu,TextInput2_26.Text)||StartsWith(OrderRefDup,TextInput2_26.Text)||StartsWith('Created By'.DisplayName,TextInput2_26.Text),OrderStatus="Cancelled"),

Radio1_1.Selected.Value="Completed",Filter(Orders,StartsWith(Title,TextInput2_26.Text)||StartsWith(Requester,TextInput2_26.Text)||StartsWith(FleetNu,TextInput2_26.Text)||StartsWith(OrderRefDup,TextInput2_26.Text)||StartsWith('Created By'.DisplayName,TextInput2_26.Text),OrderStatus="Completed"),

Filter(Orders,StartsWith(Title,TextInput2_26.Text)||StartsWith(Requester,TextInput2_26.Text)||StartsWith(FleetNu,TextInput2_26.Text)||StartsWith(OrderRefDup,TextInput2_26.Text)||StartsWith('Created By'.DisplayName,TextInput2_26.Text))),"Modified",Descending)

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @Anonymous ,

How many records stored in your data source? More than 2000?

 

Firstly, the Delegation warning issue is not an error, it just means that you could not delegate the data process to your data source, instead, you could only process data locally. In default, you could only process 500 records locally at most. You could change this limit to maximum value -- 2000, then you could process 2000 records locally at most.

 

More details about Delegation in PowerApps, please refer to the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

 

If the amount of your data source records is not more than 2000, you could ignore this warning issue. If the amount of your data source records is more than 2000, you could consider bulk-load data source records into a collection in your app, then use the collection as data source in your app.

Please check and see if the alternative solution mentioned in the following threads would help in your scenario:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Pulling-in-large-ish-SQL-tables/m-p/243777#M71518

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

@v-xida-msft  Thank you I will take a look at that, worse-case I can keep the delegation and work around it.

Thanks,

Chris

View solution in original post

6 REPLIES 6
v-xida-msft
Community Support
Community Support

Hi @Anonymous ,

Based on the needs that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider modify your formula as below:

SortByColumns(          
             Filter(
                    Orders,
                    StartsWith(Title,TextInput2_26.Text) || StartsWith(Requester,TextInput2_26.Text) || StartsWith(FleetNu,TextInput2_26.Text) || StartsWith(OrderRefDup,TextInput2_26.Text) || StartsWith('Created By'.DisplayName, TextInput2_26.Text),
                  If(
                     Radio1_1.Selected.Value="New",
                     OrderStatus="New",
                     Radio1_1.Selected.Value = "PO Created",
                     OrderStatus="Purchase Order Created",
                     Radio1_1.Selected.Value="On Hold",
                     OrderStatus="On Hold",
                     Radio1_1.Selected.Value="In Progress",
                     OrderStatus="In Progress",
                     Radio1_1.Selected.Value="Cancelled",
                     OrderStatus="Cancelled",
                     Radio1_1.Selected.Value="Completed",
                     OrderStatus="Completed"
                  )
             ),
             "Modified",
              Descending
)

 

If you also want to add the Checkbox filter to above formula, please consider modify your formula as below:

SortByColumns(          
             Filter(
                    Orders,
                    StartsWith(Title,TextInput2_26.Text) || StartsWith(Requester,TextInput2_26.Text) || StartsWith(FleetNu,TextInput2_26.Text) || StartsWith(OrderRefDup,TextInput2_26.Text) || StartsWith('Created By'.DisplayName, TextInput2_26.Text),
                  If(
                     Radio1_1.Selected.Value="New",
                     OrderStatus="New",
                     Radio1_1.Selected.Value = "PO Created",
                     OrderStatus="Purchase Order Created",
                     Radio1_1.Selected.Value="On Hold",
                     OrderStatus="On Hold",
                     Radio1_1.Selected.Value="In Progress",
                     OrderStatus="In Progress",
                     Radio1_1.Selected.Value="Cancelled",
                     OrderStatus="Cancelled",
                     Radio1_1.Selected.Value="Completed",
                     OrderStatus="Completed"
                  ),
                  If(                                // Add formula here
                     Checkbox1.Value = true,
                     RequestType = "VOR",   // I assume you use RequestType column to store the "VOR" or "Confirmation" value
                     true
                  )
             ),
             "Modified",
              Descending
)

If the RequestType column is Choice type column, please consider modify above formula as below:

SortByColumns(          
             Filter(
                    Orders,
                    StartsWith(Title,TextInput2_26.Text) || StartsWith(Requester,TextInput2_26.Text) || StartsWith(FleetNu,TextInput2_26.Text) || StartsWith(OrderRefDup,TextInput2_26.Text) || StartsWith('Created By'.DisplayName, TextInput2_26.Text),
                  If(
                     Radio1_1.Selected.Value="New",
                     OrderStatus="New",
                     Radio1_1.Selected.Value = "PO Created",
                     OrderStatus="Purchase Order Created",
                     Radio1_1.Selected.Value="On Hold",
                     OrderStatus="On Hold",
                     Radio1_1.Selected.Value="In Progress",
                     OrderStatus="In Progress",
                     Radio1_1.Selected.Value="Cancelled",
                     OrderStatus="Cancelled",
                     Radio1_1.Selected.Value="Completed",
                     OrderStatus="Completed"
                  ),
                  If(                                // Add formula here
                     Checkbox1.Value = true,
                     RequestType.Value = "VOR",   // Modify formula here. Type RequestType.Value
                     true
                  )
             ),
             "Modified",
              Descending
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks @v-xida-msft ,

 

The second code you mentioned has worked, but the If statement is giving a delegation warning. Are you able to advise a way around this?

 

Thanks,

 

Chris

Hi @Anonymous ,

How many records stored in your data source? More than 2000?

 

Firstly, the Delegation warning issue is not an error, it just means that you could not delegate the data process to your data source, instead, you could only process data locally. In default, you could only process 500 records locally at most. You could change this limit to maximum value -- 2000, then you could process 2000 records locally at most.

 

More details about Delegation in PowerApps, please refer to the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

 

If the amount of your data source records is not more than 2000, you could ignore this warning issue. If the amount of your data source records is more than 2000, you could consider bulk-load data source records into a collection in your app, then use the collection as data source in your app.

Please check and see if the alternative solution mentioned in the following threads would help in your scenario:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Pulling-in-large-ish-SQL-tables/m-p/243777#M71518

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

@v-xida-msft  Thank you I will take a look at that, worse-case I can keep the delegation and work around it.

Thanks,

Chris

View solution in original post

Hi @Anonymous ,

Is the solution I provided above helpful in your scenario?

 

If the solution I provided above is helpful in your scenario, please consider go ahead to click "Accept as Solution" identify my solution as helpful solution.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-xida-msft ,

 

Yes it has worked, thank you very much

 

Chris

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

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,338)