Skip to main content

Notifications

Community site session details

Community site session details

Session Id : xEHsdlX5Mr/oTz1qp+/C60
Power Automate - Building Flows
Answered

Create image from Base64

Like (0) ShareShare
ReportReport
Posted on 3 Oct 2022 15:10:40 by 86

I'm trying to create an image in Sharepoint based on the Base64 encoded data which I have received in JSON format.

 

This Base64 comes in as:

 

data:image/png;base64,iVBORw0KGgoAAAANSUh...

 

If I use DecodeBase64ToBinary on this, I get the error

The template language function 'base64ToBinary' was invoked with a parameter that is not valid. The value cannot be decoded from base64 representation.'.

 

However, if I remove 

 

data:image/png;base64,

 

from the start of the data, it works fine.

I thought this was needed as part of the Base64 data? It would be a pain if I have to remove it in order to decode it. 

  • ctrl_kudorje Profile Picture
    143 on 17 Apr 2025 at 18:21:14
    Create image from Base64
    what about if the data is in PDF and starts like this? 
    JVBERi0xLjMKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiA
  • DuncanIVH Profile Picture
    86 on 04 Oct 2022 at 08:48:05
    Re: Create image from Base64

    Thanks @v-xiaochen-msft 

    I could have sworn I'd tried that already, but that fixed it!

  • Verified answer
    v-xiaochen-msft Profile Picture
    on 04 Oct 2022 at 02:41:20
    Re: Create image from Base64

    HI @DuncanIVH ,

     

    Please use datauritobinary instead of base64tobinlary if the string has a head like 'data:....'

     

    Best Regards,

    Wearsky

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - Building Flows

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 223 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 222 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 194

Overall leaderboard
Loading started
Loading complete