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 / string() removes space...
Power Automate
Unanswered

string() removes spaces from JSON values

(0) ShareShare
ReportReport
Posted on by 500

When I use string(object) to turn a JSON object into a string, it does not preserve all of the spaces inside string JSON values.  Double spaces are reduced to single spaces. For example, "ANION:  Chloride" becomes "ANION: Chloride" Is there any way to stop this from happening other than replacing double spaces with another character, then change them back at the final point of use? This is a serious bug.

Categories:
I have the same question (0)
  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Hi there, 

     

    I'd like to know more specifics of the steps you've taken where you're running into this scenario. I just tried string() and I also tried placing JSON with double spacing into a string variable (just so see), with the double spacing retained in both. 

     

    Thanks,

     

    Rhia

  • jiwhite Profile Picture
    500 on at

    I create an object with a 2D array populated from an Excel file that has strings in the values. Some of our test parameters were named including double spaces years ago.

     

    jiwhite_2-1658505260769.png

     

     

    jiwhite_3-1658505387733.png

    jiwhite_0-1658504934945.png

    Then, pass it to a To-Do

    jiwhite_1-1658505004904.png

    This is how I get the test cells and convert the sensitive label in Office Script.

    jiwhite_4-1658505719754.png

    I also tried putting it in a string variable.  Whether I pass the object directly or use string(object), the same thing happens. The double spaces in test names get replaced with single spaces. To get around it, I replace "  " with "**" when creating the 2D array, then replace "**" with "  " when using the 2D array to populate another Excel File.

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard