Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Split SharePoint Person or Group Column Display Name

(0) ShareShare
ReportReport
Posted on by 149

Hi Guys,

 

I'm hoping someone can help with a problem I'm having re-formatting the display name in a SharePoint Person or Group column from 'Last Name, First Name (Company Name)' to 'First Name Last Name'. I've got a flow working that re-formats it to 'First Name (Company Name) Last Name' but I'm pretty inexperienced with Power Automate and can't figure out how to remove the (Company Name) element.

 

As an example, the display name format starts as Smith, John (Company Name) and I need it to end up as John Smith. To make it slightly more complicated, not every display name in the SharePoint list contains the (Company Name) element.

 

My current flow is as follows:

 

Screenshot 2023-08-22 095557.png    

The Condition expression is: 

empty(triggerBody()?['Requestor']?['DisplayName'])

 The first Compose expression is:

first(split(triggerbody()?['Requestor']?['DisplayName'],', '))

The second Compose expression is:

last(split(triggerbody()?['Requestor']?['DisplayName'],', '))

 

If someone could help me finish this off by removing the (Company Name) element it would be much appreciated.    

  • Matt-991599 Profile Picture
    149 on at
    Re: Split SharePoint Person or Group Column Display Name

    Further to my last reply Expiscornovus, I just noticed one other small issue.

    If I delete a name from the 'Requestor' column, it doesn't clear the 'Single line of text column' that I am updating with the result of the flow. Can I tweak the flow to achieve that? 

     

  • Matt-991599 Profile Picture
    149 on at
    Re: Split SharePoint Person or Group Column Display Name

    Hi Expiscornovus,


    You are a superstar my friend! That worked perfectly ... and irrespective of whether the display name included the (company name) element or not. Thanks so much for your help.

    Just one other quick thing - I may have something else slightly wrong in my flow because although I'm using the 'Get Item' action, it seems to be updating every item in the list each time it runs.  Can I tweak my flow somehow so it only updates the individual item that has been creted or modified?

    Thanks

  • Verified answer
    Expiscornovus Profile Picture
    31,891 Most Valuable Professional on at
    Re: Split SharePoint Person or Group Column Display Name

    Hi @Low_Flying_Bird,

     

    In the second compose you can use another split on the '(' character.

     

    Can you try the below for the second compose?

    This sample assumes it always has company name in the first name. If that is not the case you would have to check this with an indexof function instead.

     

     

    first(split(last(split(triggerbody()?['Requestor']?['DisplayName'],', ')), ' ('))

     

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492