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 - Power Automate Desktop
Suggested answer

Spitting a full name

(1) ShareShare
ReportReport
Posted on by 10
Hello,
 
I have spent a couple hours on solely trying to set up the flow so that when someone inputs their name of "John Doe", it splits it into both "John" and "Doe". For some reason I cannot get any way of splitting to work, no version of " " space works as a valid condition to split. I had to use a different method when separating their addresses as the last 10 digits would hold the postcode, but with names its not that easy.
 
Any methods to get this to work would be very much appreciated, I just need to take the text in my variable of "MainName" and split it into "Forename" and then "Surname". Too much time has been spent on this very small section of the flow- had to even make a subflow to do long attempts to get it!
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    68,094 Most Valuable Professional on at
    Spitting a full name
    Since you are using Power FX its storing the result as an object in the variable.  Add a .Value after each variable name when you use it to get just the string.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
     
  • Suggested answer
    Woody Chandler Profile Picture
    10 on at
    Spitting a full name
    Hi, its just the "Write to Excel" action.
  • Pstork1 Profile Picture
    68,094 Most Valuable Professional on at
    Spitting a full name
    Can you show a screenshot of how you are adding the value to Excel?

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Suggested answer
    Woody Chandler Profile Picture
    10 on at
    Spitting a full name
    Hello, nice to see that I am actually able to get the split to work thanks to your help! Just to ask for more help, I then use a simple "Write to Excel Workbook" action to input the details- so it would give the name like:
    Forename Surname
    John Doe
     
    However, the value being given from the "First(MainName)" action is:
    Forename Surname
    {
      "Value": "John"
    }
    {
      "Value": "Doe"
    }
     
    I guess it is just reading the literal contents of the variable, but I do not want this. I know I could do a big trim to get rid of all of that, but is there an easier method?
     
    Thanks for all your help.
  • Suggested answer
    Pstork1 Profile Picture
    68,094 Most Valuable Professional on at
    Spitting a full name
    It works, but evidently you can't nest expressions in Desktop Power Automate.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Suggested answer
    Woody Chandler Profile Picture
    10 on at
    Spitting a full name
    I do not know if I am using the "Power FX" code right, I do have it enabled on the flow though.

    I have attached a screenshot of what has been promoted to try but even then, it just responds with either errors or the equation itself.

    I am new to using the Desktop version, and I'm struggling a lot with the differences between it and the web. Unfortunately I cannot build this flow on the web version due to needing to communicate with an Access database.
  • David_MA Profile Picture
    12,363 Super User 2025 Season 2 on at
    Spitting a full name
    In addition to what @Pstork1, if the data might have leading or trailing spaces, you can use trim to remove those so you can be sure the first() and last() expressions are not affected by extra spaces in the data: first(split(trim('  John Doe  '), ' '))
  • Pstork1 Profile Picture
    68,094 Most Valuable Professional on at
    Spitting a full name
    Did you enable Power FX in the Desktop flow?  If you use Power FX you can Split("john Doe", " ") and then use First() and Last() to get the first and last names from the result.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     

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…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 532 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 358 Moderator

#3
Expiscornovus Profile Picture

Expiscornovus 276 Most Valuable Professional

Last 30 days Overall leaderboard