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

Filter,sort and search in gallery

I have a gallery that can filter a data according to cascading dropdown.

In Item gallery filter code 

 Filter(SiteSupportProfile, Team = Dropdown4.Selected.Result && SubTeam = Dropdown Dropdown5.Selected.Result && AllocationBy = Dropdown6.Selected.Result)

 

Now I would like to combine search and sort function together. In gallery I have ERPSiteName, support level and workload. I would like to sort and search ERPSiteName

 sort and search code : SortByColumns(Search(SiteSupportProfile, SearchBox.Text,"ERPSiteName"),"ERPSiteName",Ascending)

 

How to combine this filter and search  code together in item gallery?

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Nandy ,

It will not until you put something in the Search box - otherwise, try this

With(
   {
      wProfile:
      Filter(
         SiteSupportProfile, 
         Team = Dropdown4.Selected.Result && 
         SubTeam = Dropdown Dropdown5.Selected.Result && 
         AllocationBy = Dropdown6.Selected.Result
      )
   },
   SortByColumns(
      If(
         IsBlank(SearchBox.Text),
         wProfile,
         Search(
            wProfile,
            SearchBox.Text,
            "ERPSiteName"
         )
      ),
      "ERPSiteName",
      Ascending
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
Super User III
Super User III

Hi @Nandy ,

I have structured this to avoid the Delegation issue with Search

With(
   {
      wProfile:
      Filter(
         SiteSupportProfile, 
         Team = Dropdown4.Selected.Result && 
         SubTeam = Dropdown Dropdown5.Selected.Result && 
         AllocationBy = Dropdown6.Selected.Result
      )
   },
   SortByColumns(
      Search(
         wProfile,
         SearchBox.Text,
         "ERPSiteName"
      ),
      "ERPSiteName",
      Ascending
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi, Thx for the reply. I had try the code no error but no output at the same time. The gallery does not output the result after I select the dropdown.

Nandy_0-1609501943829.png

 

@Nandy ,

It will not until you put something in the Search box - otherwise, try this

With(
   {
      wProfile:
      Filter(
         SiteSupportProfile, 
         Team = Dropdown4.Selected.Result && 
         SubTeam = Dropdown Dropdown5.Selected.Result && 
         AllocationBy = Dropdown6.Selected.Result
      )
   },
   SortByColumns(
      If(
         IsBlank(SearchBox.Text),
         wProfile,
         Search(
            wProfile,
            SearchBox.Text,
            "ERPSiteName"
         )
      ),
      "ERPSiteName",
      Ascending
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

@WarrenBelz 

Thx for the quick reply. It works. Tq

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (22,569)