cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Dropdown with Choice (from SharePoint List), then filter into a gallery on another screen

I have a SharePoint list for a datasource and that SP list has a choice field called "Account Coordinator" with the names of Account Coordinators. 

I have placed this choice field onto a drop down list and would like to be able to:

  1. Click the drop-down and choose one of the names (e.g. "Kathy Smith")
  2. Then have a button where when clicked it will show all records that Kathy Smith is associated to with another SharePoint column, "Customer Name," sorted. I'd like the results to show on a gallery on another screen. 

To recap, I'd like to be able to choose an Account Coordinator from a choice drop down list in PowerApps and then further filter that to the customer name column, and have the results shown on a gallery on another screen. 

The results on the gallery on that other screen would be to show all records for "Kathy Smith" with "Customer Name" sorted.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Dropdown with Choice (from SharePoint List), then filter into a gallery on another screen

Hi @DS2,

Do you want to bind the search functionality to the Button controls in your app?

If you want to bind the search functionality to the Button controls in your app, I have made a test on my side, please take a try with the following workaround:

Within the Screen1, set the Items property of the Drop down control (Dropdown1) to following:

Choices('20190211_case5'.'Account Coordinator')

On your side, you should type:

Choices('YourSPList'.'Account Coordinator')

Set the OnSelect property of the "Filter" button ("Customer Name" button) to following:

ClearCollect(
             FilteredCollection,
             SortByColumns(
                            Filter('YourSPList', 'Account Coordinator'.Value = Dropdown1.Selected.Value), /* <-- Dropdown1 represents the Dropdown control in your previous screen */
                            "Customer_x0020_Name", 
                            Ascending
             )
),          
Navigate(Screen2, ScreenTransition.Fade)

If the Customer Name column is a Choice type column in your SP List, please type:

ClearCollect(
             FilteredCollection,
             Sort(
                            Filter('YourSPList', 'Account Coordinator'.Value = Dropdown1.Selected.Value), /* <-- Dropdown1 represents the Dropdown control in your previous screen */
                            "Customer_x0020_Name".Value, 
                            Ascending
             )
),          
Navigate(Screen2, ScreenTransition.Fade)

Within the Screen2, set the Items property of the Gallery to following:

FilteredCollection

 

 

Best regards,

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

5 REPLIES 5
Highlighted
Resolver II
Resolver II

Re: Dropdown with Choice (from SharePoint List), then filter into a gallery on another screen

Not sure what part you're having trouble with, but basically:

ddAccountCoordinator
    Items: Choices('Account Coordinator').

btnViewCustomers

    OnSelect: Navigate(scrCustomersByAccountCoordinator,ScreenTransition.None)

glryCustomersByAccountCoordinator

    Items: Sort(Filter(MyDataSource,'Account Coordinator'=ddAccountCoordinator.Selected.Value),'Customer Name',SortOrder.Ascending)

 

Highlighted
Community Support
Community Support

Re: Dropdown with Choice (from SharePoint List), then filter into a gallery on another screen

Hi @DS2,

Could you please share a bit more about your app's configuration?

Based on the needs that you mentioned, I think the Filter function could achieve your needs. I have made a test on my side, please take a try with the following workaround:3.JPG

 

4.JPG

Within the Screen1, set the Items property of the Drop down control (Dropdown1) to following:

Choices('20190211_case5'.'Account Coordinator')

On your side, you should type:

Choices('YourSPList'.'Account Coordinator')

Set the OnSelect property of the "Filter" button to following:

Navigate(Screen2, ScreenTransition.Fade)

Within the Screen2, set the Items property of the Gallery to following:

SortByColumns(
Filter('20190211_case5', 'Account Coordinator'.Value = Dropdown1.Selected.Value),
"Customer_x0020_Name",
Ascending
)

On your side, you should type:

SortByColumns(
Filter('YourSPList', 'Account Coordinator'.Value = Dropdown1.Selected.Value), /* <-- Dropdown1 represents the Dropdown control in your previous screen */
"Customer_x0020_Name",
Ascending
)

 

Above formula may cause a Delegation warning issue within your app, in order to get rid of this warning issue, please take a try with the following workaround:

Set the OnVisible property of the first screen of your app to following:

ClearCollect(RecordsCollection, 'YourSPList')

Within your other screen, set the Items property of the Gallery to following:

SortByColumns(
              Filter(RecordsCollection, 'Account Coordinator'.Value = Dropdown1.Selected.Value), /* <-- Dropdown1 represents the Dropdown control in your previous screen  */
              "Customer_x0020_Name", 
              Ascending
)

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

Filter function

 

Best regards,

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.
Highlighted
Advocate II
Advocate II

Re: Dropdown with Choice (from SharePoint List), then filter into a gallery on another screen

Thank you very much! This works. However, how can I tie the search to the button? I think it would be helpful to have other buttons (other than Customer Name) like Status or Director (these are all SharePoint Choice columns). 

Highlighted
Community Support
Community Support

Re: Dropdown with Choice (from SharePoint List), then filter into a gallery on another screen

Hi @DS2,

Do you want to bind the search functionality to the Button controls in your app?

If you want to bind the search functionality to the Button controls in your app, I have made a test on my side, please take a try with the following workaround:

Within the Screen1, set the Items property of the Drop down control (Dropdown1) to following:

Choices('20190211_case5'.'Account Coordinator')

On your side, you should type:

Choices('YourSPList'.'Account Coordinator')

Set the OnSelect property of the "Filter" button ("Customer Name" button) to following:

ClearCollect(
             FilteredCollection,
             SortByColumns(
                            Filter('YourSPList', 'Account Coordinator'.Value = Dropdown1.Selected.Value), /* <-- Dropdown1 represents the Dropdown control in your previous screen */
                            "Customer_x0020_Name", 
                            Ascending
             )
),          
Navigate(Screen2, ScreenTransition.Fade)

If the Customer Name column is a Choice type column in your SP List, please type:

ClearCollect(
             FilteredCollection,
             Sort(
                            Filter('YourSPList', 'Account Coordinator'.Value = Dropdown1.Selected.Value), /* <-- Dropdown1 represents the Dropdown control in your previous screen */
                            "Customer_x0020_Name".Value, 
                            Ascending
             )
),          
Navigate(Screen2, ScreenTransition.Fade)

Within the Screen2, set the Items property of the Gallery to following:

FilteredCollection

 

 

Best regards,

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

Highlighted
Helper IV
Helper IV

Re: Dropdown with Choice (from SharePoint List), then filter into a gallery on another screen

When are you creating the FilteredCollection, is that OnSelect?  I'm getting an error that it is not recognized.

 

Is it too complex to have more than 1 dropdown and/or text field to filter the gallery?  

 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,325)