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 / Replace space in varia...
Power Automate
Answered

Replace space in variable with period

(1) ShareShare
ReportReport
Posted on by 4

I am calling a flow from Power Virtual Agents, I am passing the user name that contains spaces e.g. Fred A Smith and I want to replace the spaces with a period i.e. Fred.A.Smith to use in a API call 

 

I initialized a variable USER_NAME with the UserName that was passed to the flow

 

I thought it would be a simple matter of using the compose to replace the characters, but no matter what I try  the USER_NAME string is not been updated. And as a result the API does not return anything.

djox_0-1658940753181.png

 

If I create a test variable in the correct format and pass that to the API my flow works correctly.

 

Am I missing something obvious?

 

Categories:
I have the same question (0)
  • Caspar_Rubin Profile Picture
    831 on at

    Instead of using the %32 etc. I usually just create a new String Variable (initialize variable) called "Space" and just put a space in it...

    Then i can use this formula: 

     

     

    replace(variables('UserName'),variables('Space'),'.')

     


    2022-07-27_19h15_30.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Output:

     

    2022-07-27_19h17_28.png

     

  • Verified answer
    Shujaath_Khan Profile Picture
    1,111 Super User 2024 Season 1 on at

    Hi @djox 

     

    replace(variables('USER_NAME'),' ','F')

     This is sufficient in compose which should do.

    Thanks

    Please click Accept as Solution on this reply if it helped to solve your issue, and thumbs-up if you feel this is useful or important in other ways as a boost.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard