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

Base64 Image not displaying

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

4 REPLIES 4
Community Support
Community Support

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

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.

Hi @JMGCORNATOR ,

 

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

Sik

@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". 

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (67,859)