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
This image here shows that the drop down works for editing a vendor within the actual app.
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".
Here is the data spot I believe
Thanks for help. Also my first post sorry is its hard to understand or the layout is weird.
Solved! Go to Solution.
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"]
Then your formula should be:
SortByColumns((Filter('Vendor List', Vendor_x0020_Type.Value = Dropdown1_1.Selected.Value)), "Company_x0020_Phone", If(SortDescending1, Descending, Ascending))
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:
Hope this helps 🙂
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)
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"
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.
Let me know if this helps, or if you need further guidance.
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.
So your formula will change to:
Filter(Vendor%20List, Vendor_x0020_Type.Value = Critical_Vendor.Selected.Value)
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)