cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
K369
Resolver I
Resolver I

Filter and sort browse gallery from dropdown

Hi all,

I am very new to Power App.

I have drop Down and have connected it to STN choices.

Choices([@'MyListt'].STN)  

I have BrowseGallery1 in which there a field called STN having choices in the list.

I want to select STN value in dropdown and want Browse gallery to filter.

I used  

Filter('MyList',Dropdown1.Selected.Value)  and its not working

Help please.

Thank you in advance

4 ACCEPTED SOLUTIONS

Accepted Solutions

@K369 ,

Try

Filter(
   'MyList', 
   STN.Value = Dropdown1.Selected.Value
)

 

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

@K369 ,

I am having difficulties understanding exactly what you need - this will allow for a blank drop-down (and the previous code should not error)

Sort(
   Filter(
      'MyList', 
      IsBlank(Dropdown1.Selected.Value) ||
      STN.Value = Dropdown1.Selected.Value
   ),
   Date,
   Descending
) 

 

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

Perfect solution . Thanks you very much. Just a question : How one can type two parallel lines as indicated in code :

Sort(
   Filter(
      'MyList', 
      IsBlank(Dropdown1.Selected.Value) ||
      STN.Value = Dropdown1.Selected.Value
   ),
   Date,
   Descending
) 

Thank you very much again Sir.

Regards 

View solution in original post

@K369 ,

It is two Pipe || symbols - on my keyboard, it is Shift \ (backslash) but it may be different on yours. It is also ASCII 124 (hold down to Alt Key and press 124 on your numeric keyboard)

View solution in original post

20 REPLIES 20
reedbg
Advocate I
Advocate I

You'll need to tell Filter which column it should be checking to see if it matches the value.  Try:
Filter('MyList', STN = Dropdown1.Selected.Value)

Thank you reedbg

I have tried and gives error as = sign

The equal to sign   ( 😃 is highlighted in red

Sorry I just wanted to state equal to sign in a bracket and it turned into emoji. Unintentional. Apology

reedbg
Advocate I
Advocate I

K369,

I don't have enough information to help troubleshoot that.  If you hover over the red equals sign, it should give you a message about what's wrong.

It Says  Invalid Argument Type

I am putting this code in Item property of Browse Gallery & hope I am right .  

@K369 ,

Try

Filter(
   'MyList', 
   STN.Value = Dropdown1.Selected.Value
)

 

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

Morning Sir

apologies to get back late. The code works perfectly and thank you very much . However how do I revert back to 

sort(‘MyList’,Date,Descending) 

after I have used drop down ?

thanks 

regards

kk369

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (27,689)