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

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
Community Support Team
Community Support Team

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.
4 REPLIES 4
sopatte
Level: Powered On

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)

 

Community Support Team
Community Support Team

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.
DS2
Level: Powered On

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

Community Support Team
Community Support Team

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.