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

Filter gallery when screen loads

Hello: 

Is there a way - a formula to filter a galley by a choice column in SPL directly i.e., without text input or having any user integration to filter the gallery?

 

In other words, when my browse screen loads, it is automatically filtered by a choice column in my SPL.

 

currently when my Screen loads the Gallery Items runs the following formula - 

SortByColumns(Filter([@bin_request_tracker], StartsWith(Title, TextSearchBox1.Text)|| StartsWith(Requested_By, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

This returns all the data in the SPL.  I would like to only return data which only contains a value from a choice column.  

 

The SPL column name is Request_Type with 3 choices.  

 

Since the choice column will not work in powerapps to return all records (Delegation issue), is there a way to copy the values to a text column in SPL?  Would that help?

 

Thanks in advance!

 

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @WarrenBelz .  Appreciate your help!  This is working - 

Request_Type.Value = "Manage existing bin(s) onsite" Or Request_Type.Value = "Deliver empty bin(s) to site"

 

View solution in original post

Hi @delucasmith ,

You would need

SortByColumns(
   Filter(
      [@bin_request_tracker], 
      (
         StartsWith(
            Title, 
            TextSearchBox1.Text
         ) || 
         StartsWith(
            Requested_By, 
            TextSearchBox1.Text
         )
      ) &&
      (
         Request_Type.Value =  "Manage existing bin(s) onsite" ||
         Request_Type.Value = "Deliver empty bin(s) to site"
      )
   ), 
   "Title", 
   If(
      SortDescending1, 
      Descending, 
      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.

Visit my blog Practical Power Apps

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @delucasmith ,

There is no Delegation issue with a Choice column (assuming it is single choice) - the below should work it you put your required value where indicated.

SortByColumns(
   Filter(
      [@bin_request_tracker], 
      (
         StartsWith(
            Title, 
            TextSearchBox1.Text
         ) || 
         StartsWith(
            Requested_By, 
            TextSearchBox1.Text
         )
      ) &&
      Request_Type.Value = "YourValueHere"
   ), 
   "Title", 
   If(
      SortDescending1, 
      Descending, 
      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.

Visit my blog Practical Power Apps

Thanks @WarrenBelz !  That worked, but I need to add a second choice.  Please advise.  I tried 

Request_Type.Value = "Manage existing bin(s) onsite", Or "Deliver empty bin(s) to site"

 

and

Request_Type.Value = "Manage existing bin(s) onsite", "Deliver empty bin(s) to site" 

 

and this doesn't work.

 

Thanks again!

Hi @WarrenBelz .  Appreciate your help!  This is working - 

Request_Type.Value = "Manage existing bin(s) onsite" Or Request_Type.Value = "Deliver empty bin(s) to site"

 

Hi @delucasmith ,

You would need

SortByColumns(
   Filter(
      [@bin_request_tracker], 
      (
         StartsWith(
            Title, 
            TextSearchBox1.Text
         ) || 
         StartsWith(
            Requested_By, 
            TextSearchBox1.Text
         )
      ) &&
      (
         Request_Type.Value =  "Manage existing bin(s) onsite" ||
         Request_Type.Value = "Deliver empty bin(s) to site"
      )
   ), 
   "Title", 
   If(
      SortDescending1, 
      Descending, 
      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.

Visit my blog Practical Power Apps

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.

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 (4,176)