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

Community site session details

Session Id :
Power Automate - Building Flows
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.
I have the same question (0)
  • creativeopinion Profile Picture
    10,480 Super User 2025 Season 2 on at
    Re: DisplayName in array variable

    @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
    Re: DisplayName in array variable

    @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
    51,890 Super User 2025 Season 2 on at
    Re: DisplayName in array variable

    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,480 Super User 2025 Season 2 on at
    Re: DisplayName in array variable

    @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
    Re: DisplayName in array variable

    @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
    Re: DisplayName in array variable

    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
    51,890 Super User 2025 Season 2 on at
    Re: DisplayName in array variable

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard