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

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

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard