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

Announcements

No record found.

News and Announcements icon
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,555 Most Valuable Professional on at
  • Suggested answer
    YUN ZHU Profile Picture
    99,084 Super User 2026 Season 1 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,946 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,177 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 555 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans