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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove all spaces from...
Power Automate
Answered

Remove all spaces from string

(1) ShareShare
ReportReport
Posted on by 248

Hi, does anyone know how to remove all spaces from a string, thus concatenating it?

 

Example: "this is my string"  when all spaces are removed it looks like "thisismystring"

Categories:
I have the same question (0)
  • Verified answer
    Gopala_Krishna Profile Picture
    1,495 on at

    @cbernier12 

     

    In the below example I have put the sentence inside a variable and used the expression to remove the whitespace.

    You can also directly put the string and use the expression.

     

    replace(variables('test'),' ','')
     
    Replace accepts three arguments, the string, pattern to search for (to be specified in single quotes), pattern to be replaced with(to be specified in single quotes).
     
    If the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved.
  • cbernier12 Profile Picture
    248 on at

    Thanks, I was trying that, however it wouldn't save.  I've discovered PA is kind of finicky and you have to select OK a number of times before formulas will take.

  • HarshChauhan Profile Picture
    52 on at

    can you tell me how can I do this in Power Automate Desktop

  • arjunrajmails Profile Picture
    14 on at

    In Replace text action,

     

    Enable the option "Use regular expressions for find and replace" and then in text to find use \s


    This will remove all the space in your text and replace with the required character. Use \b to replace with null.

    arjunrajmails_0-1656426506370.png

     

  • oprandij Profile Picture
    14 on at

    oprandij_0-1677164392359.png

    I am using this Replace Text and it is replacing the spaces with []. What am I doing wrong?

  • EERC Profile Picture
    7 on at

    @oprandij wrote:

    ...What am I doing wrong?


    Don't try to format a date as text. If you want to remove spaces in a date, use formatting expression.

     

    The example below shows how I format a date/time to remove spaces. In the next step I compose a string using this formatted date/time with a person's name. This allows me to create a unique ID used in a later step when I assign it as a title to an entity in a document library. 

     

    EERC_2-1692193157207.png

     

    Start by initializing a string variable of your invoice date, with your invoice date property as the value. Then set the variable and format the date.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard