cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Gaëlle
Level 8

Sharepoint List : Dropdowns populated with List elements to filter list Items

Hello,

 

My title maybe nebulous, but here is what i'm trying to achieve :

 

I have a custom Sharepoint List, which is used for carpooling.

Instead of a Search textbox, I would like to allow my user to filter the BrowseGallery items, with values picked from the List itself. For example, I would like to be able to filter my results by Departure Site (in the Filter dropdown, i would like to have every DepartureSite already entered in my list)

 

So, first question is :

- How to populate Dropdowns control with alreay existing information ?
I mean, I tried to add a dropdown in my BrowseScreen and write "DepartureSite" in the Items field... But PowerApps get me a "invalid name" error. Because (i Think), the dropdown control is outside my BrowseGallery. But i can't move it ! (see screenshot attached)

- Then, when this is done, I have quite the same question : How to populate another Dropdown with every already existing Departure Date that drivers already picked ?

 

- Finally, how to filter my BrowseGallery when the Dropdown changes ? I am not sure that will be automatic with the Items field.. Do i have to add (something like) a Filter('MyList';departureDate=DepartureDateFilter.Selected;departureSite=DepartureSiteFilter.Value) to my  onChange on my dropdown field ?

 

 

What i tried :

lots of thigs. I even tried with Dropdown Zone, but unfortunately it seems that it can't handle Date nor Choices already.

 

Sorry to be unclear, please ask me if i'm explaining myself wrong.

 

Thanks a lot for your help !

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Sharepoint List : Dropdowns populated with List elements to filter list Items

Hi @Gaëlle,

 

Could you please share a bit more about your SP list data source within your app?

Are the Departure Site and the Departure Date both columns within your SharePint list?

 

I think there is something wrong with the formula that you provided within the Items property of the Drop down control.

 

I have made a test on my side and don't have the issue that you mentioned. The screenshot as below:6.JPG

 

The Items property of the first Drop down control (Dropdown1, on your side, it is DepartureSiteFilter) set to following formula:

Distinct('20180620_case13',Departure_x0020_Site)

The Items property of the second Drop down control (Dropdown2, on your side, it is DepartureDateFilter) set to following formula:

Distinct('20180620_case13',Departure_x0020_Date)

Note: The '20180620_case13' represents the SP list data source within your app. The Departure Site is a Single line of text type column in my SP list, on your side, it is departureSite. The Departure Date is a Date type column (Date Only) in my SP list, on your side, it is departureDate.

 

The Items property of the Gallery control within my screen set to following formula:

Filter('20180620_case13',
Departure_x0020_Site=Dropdown1.Selected.Value&&Departure_x0020_Date=Text(Dropdown2.Selected.Value,"[$-en-US]mm/dd/yyyy")
)

On your side, type the following formula:

Filter('MyList',
departureSite=DepartureSiteFilter.Selected.Value&&departureDate=Text(DepartureDateFilter.Selected.Value,"[$-en-US]mm/dd/yyyy")
)

 

More details about the Drop down control within PowerApps, please check the following article:

Drop down control

 

More details about the Distinct function, please check the following article:

Distinct function

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Sharepoint List : Dropdowns populated with List elements to filter list Items

Hi @Gaëlle,

 

Could you please share a bit more about your SP list data source within your app?

Are the Departure Site and the Departure Date both columns within your SharePint list?

 

I think there is something wrong with the formula that you provided within the Items property of the Drop down control.

 

I have made a test on my side and don't have the issue that you mentioned. The screenshot as below:6.JPG

 

The Items property of the first Drop down control (Dropdown1, on your side, it is DepartureSiteFilter) set to following formula:

Distinct('20180620_case13',Departure_x0020_Site)

The Items property of the second Drop down control (Dropdown2, on your side, it is DepartureDateFilter) set to following formula:

Distinct('20180620_case13',Departure_x0020_Date)

Note: The '20180620_case13' represents the SP list data source within your app. The Departure Site is a Single line of text type column in my SP list, on your side, it is departureSite. The Departure Date is a Date type column (Date Only) in my SP list, on your side, it is departureDate.

 

The Items property of the Gallery control within my screen set to following formula:

Filter('20180620_case13',
Departure_x0020_Site=Dropdown1.Selected.Value&&Departure_x0020_Date=Text(Dropdown2.Selected.Value,"[$-en-US]mm/dd/yyyy")
)

On your side, type the following formula:

Filter('MyList',
departureSite=DepartureSiteFilter.Selected.Value&&departureDate=Text(DepartureDateFilter.Selected.Value,"[$-en-US]mm/dd/yyyy")
)

 

More details about the Drop down control within PowerApps, please check the following article:

Drop down control

 

More details about the Distinct function, please check the following article:

Distinct function

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Gaëlle
Level 8

Re: Sharepoint List : Dropdowns populated with List elements to filter list Items

Thanks a lot @v-xida-msft,

You gave me good hints to solve my proble m!

So, finally for DepartureDate ,I chose a DatePicker, and I solved my Dropdown issue with the Distinct. I even could add my filter.

Here are the formulas :

 

DepartureDateFilter is a DatePicker. No formula on it.

DepartureSiteFIlter is a simple DropDown. in the Items field, here is my formula :

Distinct(MyList;DepartureSite.Value)

Explanation : DepartureSite is a dropdown column in my MyList list.

 

On my BrowseGallery's Items field, I have the following :

Filter('MyList';DepartureSite.Value=DepartureSiteFilter.Selected.Value&&DateTimeValue(Text(DepartureDate)) = DateTimeValue(Text(DepartureDateFilter.SelectedDate)))

So, problem Solved !

 

But do you have any idea on how to display all items in my list, by default ? And it will only be filtered if my user select the dates/site ?

 

Thanks a lot again !

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,611)