Hellow PowerApps Community,
I'm stumped on how to pass information from a collection to a gallery.
Thanks,
HG
Solved! Go to Solution.
HI @Anonymous,
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
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)
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:
When I attempt to run this setup I receive an error:
Here is the new setup:
@Anonymous,
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.
HI @Anonymous,
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
Thank you so very much! It worked.