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

Recall - Filter, dropdown box, selected text and ClearCollect

Hi all,

 

I have created an app which is used by a training team, it has a gallery of delegates which is filtered via a dropdown to filter the training centre.  Once a delegate is selected it opens up a details screen where information is changed as needed and navigates back to the gallery once complete.  The filter resets to all when it navigates back to the gallery, how can I use a formula to allow the same selected centre to be visable to save having to select (filter) by centre again or ever time it goes back to the gallery?  Or is there another method?

 

Gallery ITEM-

If(DropdownMain.Selected.Result ="All", 'Training Tracker - (Bench Test)', Filter('Training Tracker - (Bench Test)', Centre.Value = DropdownMain.SelectedText.Result))

 

Screen ONVISABLE -

ClearCollect(CollectMain, {Result: "All"});
Collect(CollectMain, Distinct('Training Tracker - (Bench Test)', Centre.Value))

 

DropDown ITEM -

CollectMain

 

Thanks in advance!

Chris.

1 ACCEPTED SOLUTION

Accepted Solutions
CatSchneider
Helper I
Helper I

You'll want to set a variable (global or context depends on if you need the value anywhere else in your app)...

 

For Screen

  • .OnVisible = If( IsEmpty( CollectMain ), ClearCollect( CollectMain, Distinct( 'Training Tracker - (Bench Test)', Centre.Value ) ); Set( varCentre, "All" ) )

For DropdownMain...

  • .Items = CollectMain 
  • .OnChange = Set( varCentre, Self.Selected.Result )

For Gallery

  • .Items = Filter( 'Training Tracker - (Bench Test)', If( varCentre = "All", 1 = 1,  Centre.Value = varCentre ) )

View solution in original post

2 REPLIES 2
CatSchneider
Helper I
Helper I

You'll want to set a variable (global or context depends on if you need the value anywhere else in your app)...

 

For Screen

  • .OnVisible = If( IsEmpty( CollectMain ), ClearCollect( CollectMain, Distinct( 'Training Tracker - (Bench Test)', Centre.Value ) ); Set( varCentre, "All" ) )

For DropdownMain...

  • .Items = CollectMain 
  • .OnChange = Set( varCentre, Self.Selected.Result )

For Gallery

  • .Items = Filter( 'Training Tracker - (Bench Test)', If( varCentre = "All", 1 = 1,  Centre.Value = varCentre ) )
Chris_King
Helper I
Helper I

Hi @CatSchneider ,

 

Thank you for your reply, but I am well confused and need to do a bit of reading to better understand this area, as this is used else where in the app.

Thank you,

Chris.

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 (5,840)