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 / Remove spaces in a str...
Power Automate
Answered

Remove spaces in a string and add domain

(0) ShareShare
ReportReport
Posted on by 93

Hi there, 

 

I have a List which is populated when a user submits input via an App. The column name is "Submitter" for their name (e.g. "Phil Glew"). I then have a column which is the domain (e.g. "@domain.com")

 

In my flow, what code can I use to a) remove all spaces in the Submitter list entry [where ever they appear, and there may be more than one] and then auto append Domain to the end of the concatenated string?

 

Thanks

Phil

Categories:
I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @PhilGlew 

     

    concat(replace('Phil Glew',' ',''),'@domain.com')

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

  • PhilGlew Profile Picture
    93 on at

    Thanks. I should have explained that I want this to be for any new item added to the SharePoint list, not just my name....  Flow below. Looking for this code to be in the Compose box to create the email item for the name, which the Get Profile connector can then search for in the O365 directory.

     

    PhilGlew_0-1622186887172.png

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @PhilGlew 

     

    Sure, just replace the string with an expression.

     

    concat(replace('Phil Glew',' ',''),'@domain.com')

     

    concat(replace(triggerOutputs()?['body/Submitter'],' ',''),'@domain.com')

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

  • PhilGlew Profile Picture
    93 on at

    Thank you for your help. So would I need an additional step for the code to pick up that I want to replace anything in the "Name of submitter" field in the SP list?

     

    Sorry... 😞

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @PhilGlew 

     

    I don't follow you?  can you explain what you mean by "I need an additional step for the code to pick up that I want to replace anything in the "Name of submitter" field in the SP list"?

     

    Your solution is based on an item being created "trigger".  The expression I have used for this purpose is based on the same trigger.  The result of the trigger will include the column you are looking for.  You can insert the expression I have supplied into a compose, or equally you can insert it straight into the user profile action.  Either way are acceptable but with Flow you are looking to be efficient as you are limited by the number of actions per day, an inefficient flow will eat into that allowance if you have multiple flows running every day.

     

    Maybe rephrase your question and I can try to help.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

  • PhilGlew Profile Picture
    93 on at

    I have copied and pasted the code into the Compose action as...   (the column name is "Name of Submitter") and I have changed the @domain.com to just be the actual domain to be appended....

     

    concat(replace(triggerOutputs()?['body/Name of Submitter'],' ',''),'@domain.com')
     
    but the flow fails with the error...

     

    Unable to process template language expressions in action 'Compose' inputs at line '1' and column '27706': 'The template language function 'replace' expects its first parameter 'string' to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#replace for usage details.'.

  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @PhilGlew 

     

    If you expand the history for a previous flow on the trigger action, you will see the key name for the column you are looking to retrieve.  It won't have spaces in it, most likely NameofSubmitter.  You can also check this in SharePoint by goign to list settings and clicking on the column in question and viewing the URL whcih will contain the field name.  The flow history is the easiest method.  You also have the option of pasting concat(replace(,' ',''),'@domain.com') into your expression builder and switching the tab to dynamic values where you can select your column dynamically.  Just make sure your cursor is in the first parameter of the replace expression before selecting.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 86 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 55

#3
Ellis Karim Profile Picture

Ellis Karim 53 Super User 2026 Season 1

Last 30 days Overall leaderboard