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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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