web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Convert JSON to Image
Power Apps
Answered

Convert JSON to Image

(0) ShareShare
ReportReport
Posted on by 31

Hello Hoping to get some help

 

I have managed to get a Pen input to be saved as JSON in a SharePoint list.

I am now struggling to convert this into Image for use on a email and document.

I have had to use an existing SharePoint list and Power App from. I am unable to ask Power Apps and can only go off the information saved into the SharePoint item.

I am hoping I don't have to build something from scratch.

 

GrantC101_1-1612360726674.png

 

GrantC101_2-1612360746534.png

 

 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @GrantC101 ,

     

    Could you tell me:

    Have you stored many records with pictures in base64 format in the list?

    • Do you want to convert these base64 pictures into file format pictures?
    • After the conversion is completed, do you want to save the pictures to the sharepoint library or send the picture as an attachment by email?

     

    If my assumptions are correct, the key is to build a flow.

    I've made a test for your reference:

    1\ This is my list ‘LIST69’

    v-xiaochen-msft_0-1612428816451.png

     

     

    2\ Build an instant flow. When flow runs, it will convert all base64 formatted pictures in the list into files.

    v-xiaochen-msft_1-1612428816480.png

     

    File Content: dataUriToBinary(items('Apply_to_each')?['Signature'])

     

    3\ The result is as follows:

    v-xiaochen-msft_2-1612428816483.png

     

    v-xiaochen-msft_3-1612428816485.png

     

     

    Best Regards,

    Wearsky

    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • GrantC101 Profile Picture
    31 on at

    Hello @v-xiaochen-msft 

     

    I have not stored many records with pictures in base64 format in the list

    I would like to be able to put the signatures into a email and that be it.

     

    The SharePoint list just stores the JSON, and I would keep a record of the Emails

    I was looking at creating a flow when a SharePoint Item is created and then attach the signature with the existing attachment array.

    array.png

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @GrantC101 ,

     

    Could you tell me:

    • Do you want to send an email when an item is created? Does the email contain many attachments? Does the attachments come from the attachment column of the item?
    • In addition to the attachments in the Item, do you want to convert the base64 signature image to an image file and send it to the user as an attachment?
    • In other words, if an item has 5 attachments, do you want to send an email containing 6 attachments (5 attachments + 1 signature file) ?

     

    If my assumptions are correct, please try the steps below:

    1\ Build my flow

    v-xiaochen-msft_0-1612495639164.png

     

    v-xiaochen-msft_1-1612495639188.png

     

    Value: {
    
     "Name": @{items('Apply_to_each')?['DisplayName']},
    
     "ContentBytes": @{body('Get_attachment_content')?['body']}
    
    }

     

    v-xiaochen-msft_2-1612495639199.png

     

    Value: {
    
     "Name": "aa.png",
    
     "ContentBytes": @{dataUriToBinary(outputs('Get_item')?['body/Signature'])}
    
    }

     

    v-xiaochen-msft_3-1612495639202.png

     

     

    2\ The result is as follows:

    v-xiaochen-msft_4-1612495639211.png

     

     

    Best Regards,

    Wearsky

    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • GrantC101 Profile Picture
    31 on at

    Hello @v-xiaochen-msft 

     

    You have assumed correct this is exactly what I want wont to achieve.

     

    I have created the same flow as you have shown but now getting an error;

     

    Unable to process template language expressions in action 'Append_to_array_variable_2' inputs at line '1' and column '3074': 'The template language function 'dataUriToBinary' expects its parameter to be formatted as a valid data URI.

     

    here is the flow;

     

    New Flow.png

  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @GrantC101 ,

     

    Please try to delete the action in the flow or recreate a new flow.

    I ran into the same problem initially and solved it after rebuilding a flow.

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • GrantC101 Profile Picture
    31 on at

    Thank you @v-xiaochen-msft 

     

    For some reason it worked when I rebuilt it

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard