I created a search box that I need to filter the gallery by Order Number. Order Number is a list column.
I was able to get it to work using the code below.
SortByColumns(Search( Switch(
btnChoice,
Vertical,
Filter('Production Stoppage - DRAFT 1', "Vertical" in Area.Value),
Modified,
Filter('Production Stoppage - DRAFT 1', "Modified" in Area.Value),
QuickShip,
Filter('Production Stoppage - DRAFT 1', "Quick Ship" in Area.Value),
Machining,
Filter('Production Stoppage - DRAFT 1', "Machining" in Area.Value),
Repairs,
Filter('Production Stoppage - DRAFT 1', "Repair" in Area.Value),
Horizontal,
Filter('Production Stoppage - DRAFT 1', "Horizontal" in Area.Value),
Shipping,
Filter('Production Stoppage - DRAFT 1', "Shipping/Receiving" in Area.Value),
MaterialHandling,
Filter('Production Stoppage - DRAFT 1', "Material Handling" in Area.Value),
PaintBooth,
Filter('Production Stoppage - DRAFT 1', "Paint Booth" in Area.Value),
ORE,
Filter('Production Stoppage - DRAFT 1', "ORE" in Responsible.Value),
Logistics,
Filter('Production Stoppage - DRAFT 1', "Logistics" in Responsible.Value),
Purchasing,
Filter('Production Stoppage - DRAFT 1', "Purchasing" in Responsible.Value),
Quality,
Filter('Production Stoppage - DRAFT 1', "Quality" in Responsible.Value),
'Production Stoppage - DRAFT 1'
),SearchBox_2.Text,"OrderNo_x002e_"),"Created",SortOrder.Descending)
Hi @Evan_S1,
Delegation issue is normal if you have more than 2000 records in your data source.
Currently, there is no direct way to solve this issue, the only thing we can do is to use the delegable function or do the pagination thing.
Now to answer your question, SearchBox2.Text ='Order No', which does need to search a specific number you submitted to the 'Order No' column in your SharePoint list.
If you refer to SearchBox2.Text in 'Order No', which needs you input some numbers within the SearchBox2, and Power Apps will retrieve the records that contains the numbers(you input) in the 'Order No'.
I received a yellow Caution pictured below. Nothing happens when I enter an order number into the search box. The gallery stays as is. is it searching for the word "Order No" instead of needing to search by an actual number submitted to sharePoint list?
Hi @Evan_S1,
Here is the thing, you are an expert for your scenario, however I know nothing about your need and some specifal configuration at the very beginning. Especially for some error, we need to trace the source.
I won't give up on this case, thank you for your cooperation so far.😊
Since you want to filter the by order number whether a button is selected or not, please try to filter based on the search box as below:
Switch(
btnChoice,
Vertical,
Filter('Production Stoppage - DRAFT 1', "Vertical" in Area.Value, "Order No"=SearchBox_2.Text),
Modified,
Filter('Production Stoppage - DRAFT 1', "Modified" in Area.Value, "Order No"=SearchBox_2.Text),
'Quick Ship',
Filter('Production Stoppage - DRAFT 1', "Quick Ship" in Area.Value, "Order No"=SearchBox_2.Text),
Machining,
Filter('Production Stoppage - DRAFT 1', "Machining" in Area.Value, "Order No"=SearchBox_2.Text),
Repairs,
Filter('Production Stoppage - DRAFT 1', "Repair" in Area.Value, "Order No"=SearchBox_2.Text),
Horizontal,
Filter('Production Stoppage - DRAFT 1', "Horizontal" in Area.Value, "Order No"=SearchBox_2.Text),
Shipping,
Filter('Production Stoppage - DRAFT 1', "Shipping/Receiving" in Area.Value, "Order No"=SearchBox_2.Text),
'Material Handling',
Filter('Production Stoppage - DRAFT 1', "Material Handling" in Area.Value, "Order No"=SearchBox_2.Text),
'Paint Booth',
Filter('Production Stoppage - DRAFT 1', "Paint Booth" in Area.Value, "Order No"=SearchBox_2.Text),
ORE,
Filter('Production Stoppage - DRAFT 1', "ORE" in Responsible.Value, "Order No"=SearchBox_2.Text),
Logistics,
Filter('Production Stoppage - DRAFT 1', "Logistics" in Responsible.Value, "Order No"=SearchBox_2.Text),
Purchasing,
Filter('Production Stoppage - DRAFT 1', "Purchasing" in Responsible.Value, "Order No"=SearchBox_2.Text),
Quality,
Filter('Production Stoppage - DRAFT 1', "Quality" in Responsible.Value, "Order No"=SearchBox_2.Text),
Filter('Production Stoppage - DRAFT 1', "Order No"=SearchBox_2.Text)
)
I'm not understanding your question "The key to your issue is that when to filter based on the search box, when btnChoice is blank or filter based on the previous Filter() function at the same time?"
My issue is that I need the search box to filer by order number whether a button is selected filtering tickets by area or if a button is not selected and showing all tickets. The code you provided did not work and made my screen go blank with errors. Error is showing below:
Hi @Evan_S1,
It is difficult to achieve your need if you are not sure about it.😂
Okay, here is a situation for your reference:
If you want to filter the Order Number based on the Area filtering:
Switch('Production Stoppage - DRAFT 1',
btnChoice,
Vertical,
Search(Filter('Production Stoppage - DRAFT 1', "Vertical" in Area.Value),SearchBox_2.Text, "Order No"),
Modified,
Search(Filter('Production Stoppage - DRAFT 1', "Modified" in Area.Value),SearchBox_2.Text, "Order No"),
'Quick Ship',
Search(Filter('Production Stoppage - DRAFT 1', "Quick Ship" in Area.Value),SearchBox_2.Text, "Order No"),
Machining,
Search(Filter('Production Stoppage - DRAFT 1', "Machining" in Area.Value),SearchBox_2.Text, "Order No"),
Repairs,
Search(Filter('Production Stoppage - DRAFT 1', "Repair" in Area.Value),SearchBox_2.Text, "Order No"),
Horizontal,
Search(Filter('Production Stoppage - DRAFT 1', "Horizontal" in Area.Value),SearchBox_2.Text, "Order No"),
Shipping,
Search(Filter('Production Stoppage - DRAFT 1', "Shipping/Receiving" in Area.Value),SearchBox_2.Text, "Order No"),
'Material Handling',
Search(Filter('Production Stoppage - DRAFT 1', "Material Handling" in Area.Value),SearchBox_2.Text, "Order No"),
'Paint Booth',
Search(Filter('Production Stoppage - DRAFT 1', "Paint Booth" in Area.Value),SearchBox_2.Text, "Order No"),
ORE,
Search(Filter('Production Stoppage - DRAFT 1', "ORE" in Responsible.Value),SearchBox_2.Text, "Order No"),
Logistics,
Search(Filter('Production Stoppage - DRAFT 1', "Logistics" in Responsible.Value),SearchBox_2.Text, "Order No"),
Purchasing,
Search(Filter('Production Stoppage - DRAFT 1', "Purchasing" in Responsible.Value),SearchBox_2.Text, "Order No"),
Quality,
Search(Filter('Production Stoppage - DRAFT 1', "Quality" in Responsible.Value),SearchBox_2.Text, "Order No"),
Search('Production Stoppage - DRAFT 1',SearchBox_2.Text, "Order No")
)
Hi @v-qiaqi-msft,
I'm not sure, I'm still very new to PowerApps and coding/formulas.
I do have 13 "Area" buttons on the side of the dashboard page that filter the gallery by "Area", I just need to have the search box to search/filter all of them for "Order Number". I just don't know how to add that into my current code.
Hi @Evan_S1,
The key to your issue is that when to filter based on the search box, when btnChoice is blank or filter based on the previous Filter() function at the same time?
I've even tried Search('Production Stoppage - DRAFT 1', SearchBox_2.Text, "Order No") which has worked before, however I am starting to think I have put it within the current code incorrectly. how would I add this within my current code?
Switch(
btnChoice,
Vertical,
Filter('Production Stoppage - DRAFT 1', "Vertical" in Area.Value),
Modified,
Filter('Production Stoppage - DRAFT 1', "Modified" in Area.Value),
'Quick Ship',
Filter('Production Stoppage - DRAFT 1', "Quick Ship" in Area.Value),
Machining,
Filter('Production Stoppage - DRAFT 1', "Machining" in Area.Value),
Repairs,
Filter('Production Stoppage - DRAFT 1', "Repair" in Area.Value),
Horizontal,
Filter('Production Stoppage - DRAFT 1', "Horizontal" in Area.Value),
Shipping,
Filter('Production Stoppage - DRAFT 1', "Shipping/Receiving" in Area.Value),
'Material Handling',
Filter('Production Stoppage - DRAFT 1', "Material Handling" in Area.Value),
'Paint Booth',
Filter('Production Stoppage - DRAFT 1', "Paint Booth" in Area.Value),
ORE,
Filter('Production Stoppage - DRAFT 1', "ORE" in Responsible.Value),
Logistics,
Filter('Production Stoppage - DRAFT 1', "Logistics" in Responsible.Value),
Purchasing,
Filter('Production Stoppage - DRAFT 1', "Purchasing" in Responsible.Value),
Quality,
Filter('Production Stoppage - DRAFT 1', "Quality" in Responsible.Value),
'Production Stoppage - DRAFT 1'
)
This is my code below. Am I just putting it in the wrong format? The gallery still goes blank when I try to add the search box filter.
Switch(
btnChoice,
Vertical,
Filter('Production Stoppage - DRAFT 1', "Vertical" in Area.Value),
Modified,
Filter('Production Stoppage - DRAFT 1', "Modified" in Area.Value),
'Quick Ship',
Filter('Production Stoppage - DRAFT 1', "Quick Ship" in Area.Value),
Machining,
Filter('Production Stoppage - DRAFT 1', "Machining" in Area.Value),
Repairs,
Filter('Production Stoppage - DRAFT 1', "Repair" in Area.Value),
Horizontal,
Filter('Production Stoppage - DRAFT 1', "Horizontal" in Area.Value),
Shipping,
Filter('Production Stoppage - DRAFT 1', "Shipping/Receiving" in Area.Value),
'Material Handling',
Filter('Production Stoppage - DRAFT 1', "Material Handling" in Area.Value),
'Paint Booth',
Filter('Production Stoppage - DRAFT 1', "Paint Booth" in Area.Value),
ORE,
Filter('Production Stoppage - DRAFT 1', "ORE" in Responsible.Value),
Logistics,
Filter('Production Stoppage - DRAFT 1', "Logistics" in Responsible.Value),
Purchasing,
Filter('Production Stoppage - DRAFT 1', "Purchasing" in Responsible.Value),
Quality,
Filter('Production Stoppage - DRAFT 1', "Quality" in Responsible.Value),
'Production Stoppage - DRAFT 1'
); Filter('Production Stoppage - DRAFT 1','Order No' in SearchBox_2.Text)