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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

how to display image from the call http:/picture/pictureContent into an img element

(1) ShareShare
ReportReport
Posted on by 37
Hi,
I need to display the Item image on the screen. I am using the following call
 

https://api.businesscentral.dynamics.com/v2.0/<bla>/Production/api/v2.0/companies(bla)/items(bla)/picture/pictureContent 

 

I am getting back the image. But i am not sure of the image format (blob or b64 or binary etc). I need to display the image in an HTML img element.

 

New to BC. Pls help !

Thanks in advance

Prem

 

I have the same question (0)
  • PhillipsB Profile Picture
    102 on at
    Hi, 
    To display the image in <img> tag, try using JavaScript to get the image data with fetch. Convert the response to a blob and set it directly as the src for the <img> element.
     
    For example
    fetch("https://api.businesscentral.dynamics.com/v2.0/.../picture/pictureContent")
      .then(response => response.blob())
      .then(blob => {
          const url = URL.createObjectURL(blob);
          document.getElementById("yourImgElementId").src = url;
      })
      .catch(error => console.error("Error loading image:", error));
     
    This could work for most binary images returned by the API. If it’s already in base64 format, set it directly as the src
    html
    <img id="yourImgElementId" src="data:image/jpeg;base64, yourBase64String" />
     
    Hope it helps 
  • Gerardo Rentería García Profile Picture
    25,236 Most Valuable Professional on at
  • Suggested answer
    YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at
    Hi, hope the following can give you some hints.
     
    Thanks.
    ZHU

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans