cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rpearson27
Level: Powered On

DropDown Help

I have a sharepoint connection. In the share point I have created one of hte colums to be a drop down. This of course works. But now on the main screen of my app I want to be able to sort the Companies on the main screen by whether they are Critical Vendors or Non-Critical Vendors. On sharepoint when I add a vendor I have to select one of the two options via drop down. I cant figure out how to link a drop down box to filter the result for sorting purposes. 

 

 

This image shows you what it is on sharepoint

image.png 

This image here shows that the drop down works for editing a vendor within the actual app.

 

image.png

 

 

 

This image here is a picture of the app. The Vendor you see that does not currently have a photo is a "Non-Critical Vendor" and the other two are "Critical Vendor" So the drop box you see on this app I would like to be able to filter by "Non-Critical Vendor" and Critical Vendor".

image.png

 

Here is the data spot I believe

image.png

 

Thanks for help. Also my first post sorry is its hard to understand or the layout is weird.

2 ACCEPTED SOLUTIONS

Accepted Solutions
MelindaK
Level 8

Re: DropDown Help

The filter function must go on the Gallery Items property - as you said you want to filter the gallery based on the selected value of the drop down.

 

The drop down items gallery must be the  ["Critical Vendor", "Non-Critical Vendor"]

MelindaK

View solution in original post

MelindaK
Level 8

Re: DropDown Help

Then your formula should be:

SortByColumns((Filter('Vendor List', Vendor_x0020_Type.Value = Dropdown1_1.Selected.Value)), "Company_x0020_Phone", If(SortDescending1, Descending, Ascending))
MelindaK

View solution in original post

27 REPLIES 27
MelindaK
Level 8

Re: DropDown Help

Hi @rpearson27

 

To filter a gallery based on a drop down selected value, you have to make use of the Filter formula.

So your gallery Items property will have the following formula:

Filter(SP_List, Vendor_Type = Vendor_DropDown.Selected.Value)

- where SP_List is your SharePoint list name, Vendor_Type is the SharePoint column name that stores the Vendor type and Vendor_DropDown is the drop down name that selects the vendor.

 

This article gives more details about the Filter function:

https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/

 

Hope this helps 🙂 

MelindaK
rpearson27
Level: Powered On

Re: DropDown Help

Thanks for the help but unforunately I am still having issues.

 

My work so far is Filter(Vendor_x0020_List, Vendor_Type = Vendor_DropDown.Selected.Value)

image.png

 

Also for the Vendor_Type part this is the actual name of my colome. In that case do I need to do the _x0020_ for that spacet too?

 

What does this part mean 

"DropDown is the drop down name that selects the vendor"

MelindaK
Level 8

Re: DropDown Help

So, for the "Vendor Type" column you must use the name with _x0020_ instead of space (this is the internal SharePoint column name).

 

The "Vendor_DropDown" must be replaced with the name of the drop down you have presented in the second screenshot.

Screenshot_1.png

 

Let me know if this helps, or if you need further guidance.

MelindaK
rpearson27
Level: Powered On

Re: DropDown Help

Thanks, 

 

This is what I have so far and I must be off on somthing.

 

Filter(Vendor%20List, Vendor_x0020_Type = Critical_Vendor.Selected.Value)

MelindaK
Level 8

Re: DropDown Help

I have just created a sample test app, and I can see I have missed on piece of info 😐 

Because "Vendor Type" is a choice column you must use Vendor_x0020_Type.Value instead of just he column name,

A choice column is similar with a Lookup column being treated as a record in Power Apps, thus the property you want to compare must be specified.

 

https://powerapps.microsoft.com/en-us/tutorials/sharepoint-lookup-fields/

 

So your formula will change to:

 

Filter(Vendor%20List, Vendor_x0020_Type.Value = Critical_Vendor.Selected.Value)

 

 

MelindaK
rpearson27
Level: Powered On

Re: DropDown Help

image.png

 

 

It appears it does not like that either 😞 

MelindaK
Level 8

Re: DropDown Help

What's the error you are getting?

 

Hower over the yellow triangle or click inside the formula and hower over the red underlined part.

MelindaK
rpearson27
Level: Powered On

Re: DropDown Help

image.png

 

When you hover over the yellow triangle it says invalid argument type

MelindaK
Level 8

Re: DropDown Help

It looks like the list name it's not being evaluated properly as you can see the word 'List' being green.

 

Can you try to wrap the list name in ''? So you will have (if your list name contains a space, not fully sure what the %20 stands for):

Filter('Vendor List', Vendor_x0020_Type.Value = Critical_Vendor.Selected.Value)

 

MelindaK

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

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