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
Solved! Go to Solution.
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,
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
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,
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.
User | Count |
---|---|
142 | |
137 | |
78 | |
77 | |
74 |
User | Count |
---|---|
230 | |
177 | |
68 | |
68 | |
59 |