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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Base64 Image not displ...
Power Apps
Unanswered

Base64 Image not displaying

(0) ShareShare
ReportReport
Posted on by 50

Hi,

 

I am getting item pictures from Business Central using HTTP GET in Flow. Flow is testet and works fine. The data is stored as an JSON and sent back to Powerapps using a "respond"-element. In powerapps, the JSON-response is stored in a new variable as such:

Set(varItemJSON;Getitempicture.Run(VarItemID))

 

The JSON contains a Base64-string for picture that i want to display in Image4 using its image-control. However the picture will not appear and i have tried several options. see below:

OPTION 1
Concatenate(Char(34);"data:image;application/octet-stream;base64,";varItemJSON.'$content';Char(34))

OPTION 2
"data&colon;image;application/octet-stream;base64,"& <BASE64 STRING>"

OPTION 3
Char(34)& "data&colon;image;application/octet-stream;base64,"& <BASE64 STRING>" & Char(34)

 

I have read that the formula "data&colon;image;application/octet-stream;base64,& <BASE64 STRING>" must be quotes ("").

 

Strangely the picture shows when i paste in the base64 string directly as below, but this method is not an option:

"data&colon;image;application/octet-stream;base64,"& "/9j/4AAQSkZJR.....+zqPy9Xt3oLgDAYoK0CgUCg//2Q=="

 

What am i doing wrong?

 

cheers

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

    Hi @JMGCORNATOR ,

     

     

    Please check this:

     

    "data&colon;image;application/octet-stream;base64,"& varItemJSON.'$content'

     

    What you said that the formula must be quotes ("") is only for string (manual input), to make the system recognize it is a string.

    However, if you are using variable, just call it directly, no need to use quotes.

    Sik

  • JMGCORNATOR Profile Picture
    50 on at

    Hello @v-siky-msft 

    I have tried your suggestion but no result.

    I am starting to suspect that PowerApps cannot handle the input comming from Flow or that something is wrong with the way i send data from Flow to PowerApps as an error message has started to appear saying that "Getintempicture.Run failed: The data returned in the response is invalid".

     

    Strangely, when i check the status of the runned flows they are all successfully runned.

  • v-siky-msft Profile Picture
    on at

    Hi @JMGCORNATOR ,

     

    Could you show some screenshots with flow steps and the return of flow(varItemJSON)?

    Sik

  • JMGCORNATOR Profile Picture
    50 on at

    @v-siky-msft 

    Yes, sure:

    This is the overall flow:
    Save 1.png

    Basically, i get some input from the app which is used to make an HTTP GET request. The result of this request could for an example be

    {
     "$content-type": "application/octet-stream",
     "$content": <SOME BASE64 STRING>
    }

    This is loaded into an variable names "varItem". Note that "varItem" and "varItemJSON" is the same - I just changed the name.

     

    This is the part when i send back the request result:

    save 2.png

    I initialise a variable and define it an object with the value being the body of the request. Then i use a response-element in which i send back the content of "varItem". 

  • Community Power Platform Member Profile Picture
    on at

    Edit: Used dataURI to modify the image body in my flow and that got the image working offline.

    Did you ever figure this out? I'm having a similar problem where the image displays in the browser but not on the iPad app. I have code snippets etc if anyone can help. The image is in a gallery references "ThisItem.Base64Map".

  • heval Profile Picture
    8 on at

    I'm having exactly the same situation. Tried the same solutions and same results. Hard coding the string it shows but not when retrieving from a data source.

  • Community Power Platform Member Profile Picture
    on at

    @heval 

    Hey, I got it working by using flow to convert my base64, a simpler method than posted above. I'll post images below
    This flow generates when a new file is created in my sharepoint, but you could trigger it another way. The Base64RAW variable converts the body of the image into base64. The flow later filters through records and adds the base64 map code to the appropriate project record in a column titled Base64MapThis flow generates when a new file is created in my sharepoint, but you could trigger it another way. The Base64RAW variable converts the body of the image into base64. The flow later filters through records and adds the base64 map code to the appropriate project record in a column titled Base64MapAnd here it is, as long as I've selected the correct project, the base 64 loads this way. for some reason ThisItem wasnt working so i used the full First(filter way to get to the record. works fine on pc and tablet nowAnd here it is, as long as I've selected the correct project, the base 64 loads this way. for some reason ThisItem wasnt working so i used the full First(filter way to get to the record. works fine on pc and tablet now

    Let me know if this helps.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard