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

Function "binary" not returning binary string

I am currently trying to implement masks into one of my flows.

Unfortunatelly "binary" function is very uncooperative, instead of binary string, what I get from it is base64 string... in JSON.

 

What I input into compose:

binary('11')

What I expect:

1011

What I get:

{
  "$content-type": "application/octet-stream",
  "$content": "MTE="
}
 
3 REPLIES 3
Super User
Super User

Re: Function "binary" not returning binary string

If you'll review the Binary Forkflow Definition Language documentation, please notice that the binary function states:

Return the binary version for a string.

Meanwhile, you are inputting 11 which is an integer, not string - and that is the reason for the error. To use the Binary function with an integer, you must first convert it to a string. To do so, you can use the Compose action

If you could provide an expanded screenshot of your Flow and steps, and of any detailed error messages you're receiving we could likely better assist you.

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

mrpilipo
Level: Powered On

Re: Function "binary" not returning binary string

I am feeding it '11' not 11, which is a string...

But here it is with a "non-numerical" string, result is the same, input string encoded as base64 in JSON.

lgIgiZ4mFJ.pngB58dhMwOEt.png

Community Support Team
Community Support Team

Re: Function "binary" not returning binary string

Hi @mrpilipo ,

 

I did a test on my side and the test results are consistent with yours.

 

It seems that the result of this function conversion has some discrepancies with the results of other binary conversions.

 

Basically, the content is encoded by base64() function.

 

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
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 Kudoed Authors
Users Online
Currently online: 195 members 6,570 guests
Please welcome our newest community members: