cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

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
Highlighted
Community Support
Community Support

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
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (8,721)