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

How to display Multiple SharePoint items in list with shared attribute to same Label?

I have a SharePoint list that has multiple entries for names but they share a region.  I want to display the items in a label so they are Name1; Name2; Name3  and that label would change based on a dropdown.  So if I selected Region "US" it would show in the label the names that had the Region of "US" or if I selected the Region "EMEA" it would show the names that had the region set to "EMEA".

I've done showing the names in a ListBox but that shows items vertically in a list when I want to display them horizontally.  Also I need to eventually send these items to a column in another SharePoint list that would combine all the names from the region selected and write them in a single new column and have them delimited such as in example below.  

Still figuring things out in power apps so any help would be greatly appreciated.

SharePoint List 1 (Main List - Seperate Names)

Name              Region             Location
MyName         US                    Dallas, TX
MyName2       US                    Atlanta, GA
MyName3       EMEA               UK
MyName4       EMEA               Germany

SharePoint List 2 (Names combined by selected region)
Names                                   Region
MyName; MyName1             US
MyName2; MyName3           EMEA

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to display Multiple SharePoint items in list with shared attribute to same Label?

Hi @PowerAppsJunkie ,

Could you please share a bit more about the Region column in your SP list? Is it a Choice type column or Single line text column?

 

For your first question, I have made a test on my side, please take a try with the following workaround:

Add a Dropdown control (Dropdown1) within your app, set the Items property to following:

1. The Region column is a Choice type column:

Distinct('SharePoint List 1', Region.Value)

2. The Region column is a Single text type column:

Distinct('SharePoint List 1', Region)

Add a Label within your app, set the Text property to following:

Concat(       /* <-- Region is Choice type column */
             Filter('SharePoint List 1', Region.Value = Dropdown1.Selected.Result),
             Name & "; "
)

or

Concat(      /* <-- Region is Single line text type column */
             Filter('SharePoint List 1', Region = Dropdown1.Selected.Result),
             Name & "; "
)

 

 

For your second question, If you want to patch the concatenated Name items and selected region value (from the Dropdown1) back to your SharePoint List 2, I think the Patch function could achieve your needs. Please consider take a try with the following workaround:

Add a Button (called "Submit") within your app, Set the OnSelect property of the "Submit" button to following:

Patch(                                 /* <-- Region column is 'SharePoint List 2' is Choice type column */
          'SharePoint List 2',
           Defaults('SharePoint List 2'),
           {
               Names: Concat(Filter('SharePoint List 1', Region.Value = Dropdown1.Selected.Result), Name & "; " ),
Region: {
Value: Dropdown1.Selected.Result
} } )

or

Patch(                            /* <-- Region column is 'SharePoint List 2' is Single line text type column */
          'SharePoint List 2',
           Defaults('SharePoint List 2'),
           {
               Names: Concat(Filter('SharePoint List 1', Region.Value = Dropdown1.Selected.Result), Name & "; " ),
Region: Dropdown1.Selected.Result } )

Please consider take a try with above solution, check if the issue is solved.

 

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

3 REPLIES 3
Super User
Super User

Re: How to display Multiple SharePoint items in list with shared attribute to same Label?

The text property of your label would look something like this:

 

Concat(Filter('SharePoint List 1',  Region = dropdown.Selected.Value), Name, "; ")

 

*You will need to update the SharePoint list name and drop dpwn control name



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: How to display Multiple SharePoint items in list with shared attribute to same Label?

Hi @PowerAppsJunkie ,

Could you please share a bit more about the Region column in your SP list? Is it a Choice type column or Single line text column?

 

For your first question, I have made a test on my side, please take a try with the following workaround:

Add a Dropdown control (Dropdown1) within your app, set the Items property to following:

1. The Region column is a Choice type column:

Distinct('SharePoint List 1', Region.Value)

2. The Region column is a Single text type column:

Distinct('SharePoint List 1', Region)

Add a Label within your app, set the Text property to following:

Concat(       /* <-- Region is Choice type column */
             Filter('SharePoint List 1', Region.Value = Dropdown1.Selected.Result),
             Name & "; "
)

or

Concat(      /* <-- Region is Single line text type column */
             Filter('SharePoint List 1', Region = Dropdown1.Selected.Result),
             Name & "; "
)

 

 

For your second question, If you want to patch the concatenated Name items and selected region value (from the Dropdown1) back to your SharePoint List 2, I think the Patch function could achieve your needs. Please consider take a try with the following workaround:

Add a Button (called "Submit") within your app, Set the OnSelect property of the "Submit" button to following:

Patch(                                 /* <-- Region column is 'SharePoint List 2' is Choice type column */
          'SharePoint List 2',
           Defaults('SharePoint List 2'),
           {
               Names: Concat(Filter('SharePoint List 1', Region.Value = Dropdown1.Selected.Result), Name & "; " ),
Region: {
Value: Dropdown1.Selected.Result
} } )

or

Patch(                            /* <-- Region column is 'SharePoint List 2' is Single line text type column */
          'SharePoint List 2',
           Defaults('SharePoint List 2'),
           {
               Names: Concat(Filter('SharePoint List 1', Region.Value = Dropdown1.Selected.Result), Name & "; " ),
Region: Dropdown1.Selected.Result } )

Please consider take a try with above solution, check if the issue is solved.

 

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

PowerAppsJunkie
Level: Powered On

Re: How to display Multiple SharePoint items in list with shared attribute to same Label?

Thanks to both @Jeff_Thorpe and @v-xida-msft 

 

Concat was the thing I was missing.  I got the context all sorted and it's working as indended.  

 

Thanks so much for the helpful examples and the level of detail.  Really appreciate it.

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 168 members 5,504 guests
Please welcome our newest community members: