cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IPC_ahaas
Responsive Resident
Responsive Resident

Drop down List from SharePoint List Filtering

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:

 

Filter(
CHMerchandise,
Title = DrpItemChosenTypeExchange.SelectedText.Value,
)

 

but it its an empty list. I cannot see how to display the ItemDescription in the list with the filter.

16 REPLIES 16
RandyHayes
Super User
Super User

@IPC_ahaas 

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.

Ex:

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.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
IPC_ahaas
Responsive Resident
Responsive Resident

Awesome, that's good to know. I'm sure there's a context will this will come into play.

IPC_ahaas
Responsive Resident
Responsive Resident

When I try and use the filtered drop down DropItemChosenDescriptionExchange in my Patch, it says it doesn't match the expected type "Text".

 

ItemChosen: DropItemChosenDescriptionExchange.Selected.Value

 

I also tried Selected.Result and got the same error.

RandyHayes
Super User
Super User

@IPC_ahaas 

.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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
RandyHayes
Super User
Super User

@IPC_ahaas 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Wow, you blew my mind with that one. Make total sense.

RandyHayes
Super User
Super User

@IPC_ahaas 

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!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (3,050)