cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Passing Collection values?

Hellow PowerApps Community,

 

I'm stumped on how to pass information from a collection to a gallery. 

 

  • I've successfully created a collection
  • Successfully populated a drop-down button with the collection info
  • But, I can't figure out how to pass the selected collection option from the drop-down button to my gallery

 

Collection_Question.jpg

Thanks, 

HG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Passing Collection values?

HI @HumbleGenius,

 

I agree with @Drrickryp and @CarlosFigueira's thought almost.

 

Please take a try with the following formula:

Filter('External Table Data source',Treatment=Dropdown1.Selected.Value)

or

Filter('External Table Data source',Treatment=Dropdown1.Selected.Result)

 

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Power Apps
Power Apps

Re: Passing Collection values?

You can reference the 'Selected' property of the dropdown in the gallery Items property to filter it based on the dropdown selection. Something like the expression below:

Filter(
    YourCollection,
    Treatment_ID = Dropdown1.Selected.Treatment_ID)
Highlighted
Advocate II
Advocate II

Re: Passing Collection values?

Thank you CarlosFigueira for your quick response. The solution you provided does work when only using the Treatment _ID. 

 

But let's say that I wanted to:

 

  1. Add a new Data Source that the drop down button will search on using the Treatment collection column instead of the original Treatment_ID  to filter my gallery.

When I attempt to run this setup I receive an error:

Error_2.png

 

Here is the new setup: 

Treatment_2.png

 

 

 

Highlighted
Super User III
Super User III

Re: Passing Collection values?

@HumbleGenius,

I think the answer for your follow up question regarding your new example, is simpler than you think.  In the example, you are using the Distinct function to create the collection for your dropdown.  This is not really necessary if the datasource for the dropdown Treatment column is unique.  Carlo's solution will work nicely for that because the Dropdown is displaying one column of an entire record and the other columns not shown can be referenced: If that is the case, you would simply set the Items property of your gallery to Filter(Treatment_Collection,Treatment=Dropdown1.Selected.Treatment).

 

The Distinct() function is useful if you want to derive a unique list of treatments from an external table that contains duplicate treatments in the Treatment column.  When you use the Distinct() function you create a one column table with the column name = Result. If you use that as the Items property of your Dropdown, assuming the Dropdown is named Dropdown1, to filter your data source, you would need to set your gallery Items property to Filter(Treatment_Collection, Treatment=Dropdown1.Result).  You shouldn't get an error in this case since both conditions of the Filter are Text.  

Highlighted
Community Support
Community Support

Re: Passing Collection values?

HI @HumbleGenius,

 

I agree with @Drrickryp and @CarlosFigueira's thought almost.

 

Please take a try with the following formula:

Filter('External Table Data source',Treatment=Dropdown1.Selected.Value)

or

Filter('External Table Data source',Treatment=Dropdown1.Selected.Result)

 

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Passing Collection values?

Thank you so very much! It worked. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,578)