web
You’re offline. This is a read only version of the page.
close
Skip to main content
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

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:
I have the same question (0)
  • v-bacao-msft Profile Picture
    on at
    Re: Don't Auto-Capitalize Boolean Value

     

    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
    Re: Don't Auto-Capitalize Boolean Value

    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
    Re: Don't Auto-Capitalize Boolean Value
    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

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

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard