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:
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.