I have a CHMerchandise List of products.
First column Title is the type of item.
Second column ItemDescription is the item description.
In the PowerApp:
First drop down is DrpItemChosenType with Items=Distinct(CHMerchandise,Title).
Second drop down is DrpItemList.
I want to have DrpItemList be a list of all items from CHMerchandise where the Title matches the selected DrpItemChosenType.
I can filter the second drop down:
Title = DrpItemChosenTypeExchange.SelectedText.Value,
but it its an empty list. I cannot see how to display the ItemDescription in the list with the filter.
Solved! Go to Solution.
Yes, your Items property of the dropdown control is returning the Full record of the CHMerchandise datasource that matches the filter. This will include ALL columns. Dropdown has to be told what column to display. That is where you tell it.
Incidentally, you can also specify a single column on your formula.
Filter(CHMerchandise, Title = DrpItemChosenTypeExchange.Selected.Result ).ItemDescription
When you include a single column name on any table, PowerApps will return a table with JUST that column. The dropdown would then automatically use that column in the View setting because it has no other column to "guess".
This is fine in some cases if that is all you need, but the advantage to having the full record is that you can then reference the selected item of your dropdown and reference ANY column you have in it. With the single column formula above, the selected item would ONLY have the single column to reference.
When I try and use the filtered drop down DropItemChosenDescriptionExchange in my Patch, it says it doesn't match the expected type "Text".
I also tried Selected.Result and got the same error.
.Value and .Results are names of column in the Selected record. Does it have those? I highly doubt it. You need to reference the column name from the record.
To clarify the above...if you use a formula that returns a table of items with a Result column (like a Distinct), then .Result will be a valid column name in the record.
If you use a fomula that returns a table of items with a Value column (like a Choices or a variety of many others), then .Value will be a valid column name in the record.
But you are specifying the full record of your DataSource...so whatever column name you want from that is what you want on the Selected. i.e. Selected.ID Selected.Name Selected.Title Selected.ItemDescription etc. etc.
Yes...many get hung up on seeing example of .Result and .Value for Selected properties. This is not a firm "here's what you use". It is completely and highly depended on the record of the Selected item. And that record schema is governed by the Items property record schema.
Think this way (and note, this applies to ALL controls in PowerApps that have an Items property):
Dropdown and Combobox controls:
Items - a table of records. All records have a schema. Single column or multiple columns, but they have a schema.
Selected - THE record selected. That record will be the identical schema of the Items.
SelectedItems (for Comboboxes) - A table of records selected. Those records will have the identical schema of the items.
Default (dropdown) - a text property identifies the text value of the field chosen to display in the dropdown to be selected by default.
Default (combobox) - worthless...it does nothing!
DefaultSelectedItems (combobox) - a table of records (with the exact schema as the items property) that should be selected by default.
Note, most all of the above applies to Radio, ListBox, and Gallery controls. They all have Items properties and they expose selected records of those Items.
Just a little extra info for you!
Keep up to date with current events and community announcements in the Power Apps community.
Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.
Check out the latest Community Blog from the community!