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 / Don't Auto-Capitalize ...
Power Automate
Unanswered

Don't Auto-Capitalize Boolean Value

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I'm building a JSON object for an HTTP Response action, but I'm getting an error that my JSON is malformed. When examining the body, I see that this is because my Boolean types have their first letter capitalized. According to the JSON spec, Booleans must be lowercase, so that's definitely the issue.

 

However, I already know that true/false are acceptable and True/False are not, and have been setting & passing lowercase Booleans without issue. The difference this time is that I'm working with the Booleans in the context of a string variable.

 

Capitalization.png

 

Flow is formatting my Boolean type as some kind of non-standard string, and nothing that I've tried has been able to fix it. I expected to be able to simply pass the variable in without issue:

 

Expected Solution.png

 

But as we've seen, that doesn't work. I also tried pulling the changed variable into a compose action before using it in the Append to string variable action, but the Boolean is lowercase in the Compose and the Compose becomes uppercase when it's used in the Append action.

 

According to a post on the Flow help forum, this logic is by design. I can't understand why such behavior would be desired, but there must be a way to circumvent it, right? Is there a method for returning a raw/unformatted variable? I have tried:

 

 

 

 

bool(tolower(string(body('HTTP:_Field_Changed')?['changed'])))

 

 

 

 

 However, that didn't seem to make any difference. I'm lead to believe that this behavior is part of the Append to string variable action, but I can't skip that step, so any other thoughts or help are appreciated!

 

I can't change the type to string or int because the call that I'm replying to expects a (well-formed) JSON Boolean, and I would like to avoid a bunch of casting because I have several similar actions inside a loop, so all of those extra resources would equate to extra time.

 

Thanks for your help!

Categories:
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @Anonymous ,

     

    If you are concatenating strings, maybe you can try using concat () instead of Append to string variables.

     

    Best Regards,

  • MatejSamler Profile Picture
    16 on at

    For anyone having this issue: 

    Sadly, this is still a thing. The only real way to print valid json is to do an unneccesary check like this: 
    if(triggerOutputs()?['body/somebool'],'true','false')


  • DennisGaida Profile Picture
    3 on at
    if(triggerOutputs()?['body/somebool'],'true','false')

    Unfortunately doesn't work for me in a bool variable being inserted into an Adaptive Card. What did work for me is quoting the bool, i.e. "isVisible": "False". Adaptive Cards fortunately also work with quoted bools...

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard