cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AVividLight
Level: Powered On

Don't Auto-Capitalize Boolean Value

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!

1 REPLY 1
Community Support Team
Community Support Team

Re: Don't Auto-Capitalize Boolean Value

 

Hi @AVividLight ,

 

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

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,596)