web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Collection Help

(0) ShareShare
ReportReport
Posted on by 106

I am trying to create a collection based on a collection from a Sharepoint List. The SP list uses People columns, and I needed to pull the names out of the record format they are in for access. However, I would really like to stack the "Member Display" and "MemberAlternative" Columns. But with this code I am just getting in blanks. I thought this was processing it from Add Column, to Rename and finally Show Columns, but I must be missing something because I am getting nothing, and it doesn't seem to be Renaming my column just adding another one with the new name.

Clear Collect (
colPeopleCases,
Show Columns (
Rename Columns (
AddColumns(
colCases,
"CaseID",
ID,
"MemberDisplay",
MemberName.DisplayName,
"MemberAlternative",
Member,
"ContactDisplayName",
Contact.DisplayName,
"ReachCoordinatorDisplayName",
ReachCoordinator.DisplayName
),
"MemberDisplay",
"MemberDisplayName"
),
"CaseID",
"MemberDisplayName",
"MemberAlternative",
"ContactDisplayName",
"ReachCoordinatorDisplayName"
)
)

 

hsfournier_0-1648781013131.png

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,393 Most Valuable Professional on at

    HI @hsfournier ,

    What do you mean by "stack" these names? These is nothing wrong with the code (apart from you not needing the RenameColumns, providing colCases has the data in it at the time. If you actually want two fields with the same content

    ClearCollect( 
     colPeopleCases,
     ShowColumns(
     AddColumns(
     colCases,
     "CaseID",
     ID,
     "MemberDisplayName",
     MemberName.DisplayName,
     MemberDisplay",
     MemberName.DisplayName,
     "MemberAlternative",
     Member,
     "ContactDisplayName",
     Contact.DisplayName,
     "ReachCoordinatorDisplayName",
     ReachCoordinator.DisplayName
     ),
     "CaseID",
     "MemberDisplay",
     "MemberDisplayName",
     "MemberAlternative",
     "ContactDisplayName",
     "ReachCoordinatorDisplayName"
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • WarrenBelz Profile Picture
    154,393 Most Valuable Professional on at

    HI @hsfournier ,

    What do you mean by "stack" these names? These is nothing wrong with the code (apart from you not needing the RenameColumns), providing colCases has the data in it at the time. Note that MemberAlternative will be a People Table field

    ClearCollect( 
     colPeopleCases,
     ShowColumns(
     AddColumns(
     colCases,
     "CaseID",
     ID,
     "MemberDisplayName",
     MemberName.DisplayName,
     "MemberAlternative",
     Member,
     "ContactDisplayName",
     Contact.DisplayName,
     "ReachCoordinatorDisplayName",
     ReachCoordinator.DisplayName
     ),
     "CaseID",
     "MemberDisplayName",
     "MemberAlternative",
     "ContactDisplayName",
     "ReachCoordinatorDisplayName"
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • hsfournier Profile Picture
    106 on at

    Hi Warren,

     

    I really like your blog, the info is nicely organized, and it's easy to find things. When I say stacked, my understanding is that when you have 2 columns with similar info, in this case people's names, you can use the Rename function to stack those values into one column in this way.

    ClearCollect(newCollectionName, RenameColumns(oldCollectionName.Member,"Member","MemberDisplayName"),

    RenameColumns(oldCollectionName.MemberName,"MemberName","MemberDisplayName"))

    and that powerapps will then combine (stack) the info from what was in the "Member" and "MemeberName" column into one column called "MemberDisplayName". I am sort of getting it to work, but i had to add another step outside the code I originally put up, and there are definately blanks because when I pulled it into a gallery to see how it worked, there were large spaces between some names. I really want to get the info from those 2 columns into one column. The MemberAlternative is not set up as People column, just plain text, as it was added as we were having an issue with not being able to add people to the App using the People column due to IT issues with AD, so I don't have to worry about DisplayName for that one.

     

    Right now I am thinking of adding a Drop Columns to the formula to get rid of the extra columns, as the rename doesn't seem to be working. I'd be really interested to hear what you might suggest. 

  • Verified answer
    WarrenBelz Profile Picture
    154,393 Most Valuable Professional on at

    HI @hsfournier ,

    If you want to combine two columns, just use & between them in AddColumns, but I am still a bit confused as you have used Member (which is a Person column and therefore a Table) in MemberAlternative - example if you wanted to combine Member and Contact DisplayNames

    ClearCollect( 
     colPeopleCases,
     ShowColumns(
     AddColumns(
     colCases,
     "CaseID",
     ID,
     "MemberDisplayName",
     MemberName.DisplayName,
     Member_Contact",
     MemberName.DisplayName & " " & Contact.DisplayName,
     "MemberAlternative",
     Member,
     "ContactDisplayName",
     Contact.DisplayName,
     "ReachCoordinatorDisplayName",
     ReachCoordinator.DisplayName
     ),
     "CaseID",
     "MemberDisplay",
     "MemberDisplayName",
     "MemberAlternative",
     "ContactDisplayName",
     "ReachCoordinatorDisplayName"
     )
    )

    but you cannot do this with a Table (Member), only a Text element (Member.DisplayName)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

     

  • hsfournier Profile Picture
    106 on at

    Thank you so much! I realize I was overthinking it and made it much more complex then needed, I just needed to use the &. 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard