cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
golfnutt82
Super User
Super User

Replace a blank char with a hyphen

Hello,
I have a variable called strSiteName and it is possible for the site name to have blank spaces like I like cats 05-31-2022 but I dont want spaces in my string as it is used to build a URL and %20 causes undesirable effects in an HTTP call down the line.
For the life of me I am not able to get my replace expression to work no matter what I try.
Please let me know what I could be missing or doing wrong.
Thank you

Replace(variables('strSiteName')'" "','-') or
Replace(variables('strSiteName')'','-') or

Replace(variables('strSiteName')'%20','-')

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarvinBangert
Super User
Super User

Hi @golfnutt82 

you are missing a comma after your variable().

This should work:

Replace(variables('strSiteName'),' ','-')

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

View solution in original post

2 REPLIES 2
MarvinBangert
Super User
Super User

Hi @golfnutt82 

you are missing a comma after your variable().

This should work:

Replace(variables('strSiteName'),' ','-')

 

Does this help you? Otherwise please give me some more information.

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Blog: Cloudkumpel

Thanks Marvin! SMH

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,761)