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

string() removes spaces from JSON values

(0) ShareShare
ReportReport
Posted on by 498

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,690 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
    498 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

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