cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tpj1215
Frequent Visitor

How to sortbycolumn and filter Multiple comboboxes and text input in a gallery

powerapps_Q1.png

I'm using sharepoint list to import data to PowerApps canvas.

I have 5 comoboboxes and 2 text input to filter and search items in a gallery.

Current coding can filter Quarter, BU, CurrentWK, Customer, Month, and ID.

 

Search(Filter(Data,
(IsBlank(BU_Filter_2.SelectedItems) || IsEmpty(BU_Filter_2.SelectedItems) || BU in BU_Filter_2.SelectedItems) &&
(IsBlank(Quarter_Filter_2.SelectedItems) || IsEmpty(Quarter_Filter_2.SelectedItems) || 'Qtr' in Quarter_Filter_2.SelectedItems) &&
(IsBlank(CurrentWK_Filter_2.SelectedItems) || IsEmpty(CurrentWK_Filter_2.SelectedItems) || CurrentWK in CurrentWK_Filter_2.SelectedItems) &&
(IsBlank(Month_Filter_2.SelectedItems) || IsEmpty(Month_Filter_2.SelectedItems) || Month in ShipMonth_Filter_2.SelectedItems) &&
(IsBlank(Customer_Filter_2.SelectedItems) || IsEmpty(Customer_Filter_2.SelectedItems) || Customer in Customer_Filter_2.SelectedItems)
), OppID_Search_2.Text, "field_4")

 

I would like to

(1) add Slot text input  in the search code

(2) default galley view = sort by Quarter in descending order & Risk Level in descending order

 

I tried modifying multiple times, but had no good luck. 

@WarrenBelz 

4 REPLIES 4
Drrickryp
Super User
Super User

With({BU1:BU_Filter_2.SelectedItems,
      QF:Quarter_Filter_2.SelectedItems,
      CW:CurrentWK_Filter_2.SelectedItems,
      SM:ShipMonth_Filter_2.SelectedItems,
      CU:Customer_Filter_2.SelectedItems
      FGIdata:Filter(FGI_Data_V12,
		Or(IsBlank(BU1),IsEmpty(BU1),BU in BU1),
		Or(IsBlank(QF),IsEmpty(QF),'FGI From Qtr' in QF),
		Or(IsBlank(CW),IsEmpty(CW),CurrentWK in CW),
		Or(IsBlank(SM),IsEmpty(SM),ShipMonth in SM),
		Or(IsBlank(CU),IsEmpty(CU),Customer in CU)
      },
    SortbyColumns(
       Search(
              FGIdata,OppID_Search_2.Text,"field_4","SlotTextField"
        ),"Quarter",Descending,"Risk Level",Descending
     )

)

tpj1215_0-1652385467054.png

I get this error...

Drrickryp
Super User
Super User

@tpj1215 

With({BU1:BU_Filter_2.SelectedItems,
      QF:Quarter_Filter_2.SelectedItems,
      CW:CurrentWK_Filter_2.SelectedItems,
      SM:ShipMonth_Filter_2.SelectedItems,
      CU:Customer_Filter_2.SelectedItems
      FGIdata:Filter(
                     FGI_Data_V12,
		      Or(IsBlank(BU1),IsEmpty(BU1),BU in BU1),
		      Or(IsBlank(QF),IsEmpty(QF),'FGI From Qtr' in QF),
		      Or(IsBlank(CW),IsEmpty(CW), CurrentWK in CW),
		      Or(IsBlank(SM),IsEmpty(SM) ,ShipMonth in SM),
		      Or(IsBlank(CU),IsEmpty(CU), Customer in CU)
              )
      },
    SortByColumns(
       Search(
              FGIdata,OppID_Search_2.Text,"field_4","SlotTextField"
        ),"Quarter",Descending,"Risk Level",Descending
     )

)

hmm. missed a ")" and fixed syntax on SortByColumns

The other I suspect is the correct name for the Risk Level column.  

With({BU1:BU_Filter_2.SelectedItems,
QF:Quarter_Filter_2.SelectedItems,
CW:CurrentWK_Filter_2.SelectedItems,
SM:ShipMonth_Filter_2.SelectedItems,
CU:Customer_Filter_2.SelectedItems
FGIdata:Filter(
FGI_Data_V12,
Or(IsBlank(BU1),IsEmpty(BU1), BU in BU1),
Or(IsBlank(QF),IsEmpty(QF),'FGI From Qtr' in QF),
Or(IsBlank(CW),IsEmpty(CW), CurrentWK in CW),
Or(IsBlank(SM),IsEmpty(SM), ShipMonth in SM),
Or(IsBlank(CU),IsEmpty(CU), Customer in CU)
)
},
SortByColumns(
Search(
FGIdata,OppID_Search_2.Text,"field_4",Slot_Search_2.Text, "field_17"
),"FGI From Qtr",Descending,"CurrentWK",Descending
)

)

 

still does not work...

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (4,074)