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 Platform Community / Forums / Power Automate / DisplayName in array v...
Power Automate
Answered

DisplayName in array variable

(0) ShareShare
ReportReport
Posted on by

I am trying to append my array variable with the DisplayName of a Person Column in SharePoint.  I was able to get the entire Person information to append, but I haven't figured out how to mine only the DisplayName from the Person column.

 

Here's my flow up to the error:

cmegow_0-1696125442348.png

 

Here is the Table that I'm creating with the Select Function:

cmegow_1-1696125505996.png

 

Here is the expression that is not working: 

item()?['FGMCustodian']['DisplayName']
 
Thanks for any thoughts on how to fix this issue.
Categories:
  • creativeopinion Profile Picture
    10,508 Moderator on at

    @cmegow In your Select - Final Building list action, what is the reason you are using the variable instead of using the Value dynamic content from the Get Items Building List action?

     

    Can you provide more insights as to what is happening in the Apply to Each actions after each Get Items action in your flow?

     

  • cmegow Profile Picture
    on at

    @creativeopinion 

    I'm simply pulling in all the data from the SharePoint list and writing it to my array in the earlier steps.  Ultimately, I need to combine the BuildingList array and the CustodialReport array to create a monthly report which includes all buildings, even those that don't have a custodial report for the month.

     

    cmegow_0-1696129350978.png

     

    Here are the settings from the SharePoint List, as well.

    cmegow_1-1696129586263.png

    This list is used in many other flows, so it would be hard to change the list.

  • Michael E. Gernaey Profile Picture
    53,980 Super User 2026 Season 2 on at

    Hi,

     

    I am assuming this is a Multi-Select people. You cannot just put the path like you have, IF its a multi-select people column, because what you are putting in is actually a Table or rows, not a single thing.

     

    And you cannot simply point to it this way. You would have to use an Apply to Each, before the Select, to iterate through the current items, Field.DisplayNames(1-m), concat them together and THEN assign the output of that apply to each to the Select value . So now you cannot take multiple display names and treat it like its going to get assigned like that. YOu would need to assign the Parent of DisplayName (the column itself).

     

    Think of it this way. the other stuff you put in are a property of the Array/Object, what you are trying to do with the Display name is go multi-level deep and treat it like IT itself would be an array of Display Names. Can't do that.

     

    You have this:

    value: [

    {

       Title: "",

        PeopleColumn: [ {DisplayName, DisplayName etc } ] 

    So you cannot get the path to it that way since, DisplayName is not a property it is an Array

    }

    ]

     


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • creativeopinion Profile Picture
    10,508 Moderator on at

    @cmegow Can you show what the final report looks like? Are you looking to display a list of buildings assigned to each Custodian? I also see a Filter Array action at the bottom of your first screenshot—can you provide some insights?

     

    Apply to Each

    The Apply to each action in your flow (how you've used it isn't necessary). The Get Items action returns the list of items from your SP List in an array. In the screenshot below I've used a Compose action to output the value dynamic content from the Get Items action. 

     

    creativeopinion_0-1696170435338.png

     

    What you've done in your flow is use an Apply to each action to loop through each item returned and appended it to an array. This is unnecessary as the output is the identical to the output that the value dynamic content from the Get Items action.

    creativeopinion_2-1696170634752.png

     

    creativeopinion_1-1696170474651.png

     

    Select Action

    You can use the Select action to pull the values you'd like returned from your SP List like this:

    creativeopinion_3-1696170811694.png

     

     

  • Verified answer
    cmegow Profile Picture
    on at

    @creativeopinion I found a work around.  I changed the expression to display the claims since that actually exists as a column in the data "item()?['FGMCustodian#Claims']".  Then, I used another Select function and an if expression to replace the claims with the name of the Custodian.  This required a little bit of hard coding, but we only have two custodians, and they only change like every 5 years.  So, no problem to hard code in this case.

  • Ramiz Profile Picture
    245 on at

    Hi @cmegow 

    You can try adding just the display names in the array instead of entire person information.

    Ramiz_0-1696195423116.png

     

  • Michael E. Gernaey Profile Picture
    53,980 Super User 2026 Season 2 on at

    Hehe its always bad to hard code.

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard