Skip to main content

Notifications

Community site session details

Community site session details

Session Id : SP1zuLNjm/YUt6FJkA1eDT
Power Apps - Building Power Apps
Unanswered

Is it possible to display app internal image in an HTML control?

Like (3) ShareShare
ReportReport
Posted on 6 Jan 2017 12:23:17 by 25

 

I am creating an 'about' page in my first test PowerApp, with an HTML control containing text about the app including images within the text.

I can include img src tags that point to an image hosted on an external site, however, I want to include image(s) packaged with the app.

I have tried putting an image control on the page which uses an image from the media section. I then created a text control whose 'Text' value I set to the image.

This returns :

ms-appdata:///local/Resources/Assets/Images/coffee.png

so I put that in my HTML control eg

"This is the <b>PowerApp</b> '<i>Test</i>'<br><br>Image from external site : <br> <img src=""http://www.photos-public-domain.com/wp-content/uploads/2016/11/green-grass-and-blue-sky-landscape-600x450.jpg""><br><br>Image from Media : <br><img src=""ms-appdata:///local/Resources/Assets/Images/coffee.png"">"

The external image displays ok, but there is nothing showing for the Image from Media.

I tried removing 'ms-appdata' (///local/Resources/Assets/Images/coffee.png) and that now shows me what I believe to be the default placeholder icon for 'image not found'

Clearly the HTML control is ok with displaying images via the img tag, but is there a problem pointing to images from within the app itself?

A work around would be to have multiple HTML controls, before and after an image control, but this is less flexible and harder to maintain.

Thanks.

  • mustafaasiroglu Profile Picture
    Microsoft Employee on 01 Jun 2021 at 14:47:53
    Re: Is it possible to display app internal image in an HTML control?

    Hello everyone, I found a workaround to show internal image including camera input in HTML control!

    - Add an image control to your canvas and set image source as you wish
    - Get image content base64 using following formula:
       Set(imagecontent, JSON(ImageControl1.Media, IncludeBinaryData);
       Set(imagecontentclean, Mid(imagecontent,2,Len(imagecontent)-2))
    - Use this base64 uri in your HTML control as image src:
       "<img src='"&imagecontentclean&"' width='112' height='63' />"


    It works perfectly but there is a minor limitation: HTML input controls seems to start freezing when image file is large. (Means very long string is feeded as html input) I observed this issue in edit mode, it may work without an issue for end users. I hope Power Apps team improves performance issues regarding this limitation soon.


  • Office365Master Profile Picture
    338 on 04 Jul 2018 at 16:50:08
    Re: Is it possible to display app internal image in an HTML control?

    Display SharePoint Images Powered Up Style In PowerApps

    Display any image stored anywhere in SharePoint Online, rendered within an app in any resolution / quality as you so desire and highly compressed in size vs. the original image actually stored in SharePoint.

     

    Mobile Video Demo
    Desktop Video Demo

  • Justin Reading Profile Picture
    31 on 01 Aug 2017 at 00:16:28
    Re: Is it possible to display app internal image in an HTML control?

    When I attempt to access Media images and display them in an image control the "url" is stated as "appres://resources/imagename.png" or similar. Whilst this approach works when this url is called from a SharePoint Online list as 'ThisItem.imageName', to display the image in preview mode in the Windows 10 studio App and in Internet Explorer, as soon as I publish the App and access from the PowerApps mobile device (on Android) the images will not display.

     

    More specifically here is what I'm attempting to do:

     

    1. Display a list of 'Titles' from the SPO site to populate a gallery (this works).

    2. Have the 'imageName' URL as a selectable label (sitting above the 'Title' in the gallery) which is not visible (this works).

    3. Pass the name of the label (the image url appres://etc.) to the 'Image' field in an image control (OnSelect this works)

    4. Have the image control change the photo based on the label selected (this works in PowerApps Studio and IE).

    5. Publish App to mobile users (App works, but images do not display).

     

    If the images imported as "media" are package with the App I don't understand how they are not being displayed when the data that is being used for gallery is on a SPO site behind permission and MFA restrictions displays correctly....

     

    Any advice??

  • v-micsh-msft Profile Picture
    on 09 Jan 2017 at 09:11:14
    Re: Is it possible to display app internal image in an HTML control?

    Hi @WinIOSAndroid,

     

    Currently the available way to show the "Internal " image under PowerApps is using the image control.

    There is no information mentioned under the official articles regarding how to display internal image through the HTML control:

    Add an image, a video, or a sound

    If you would like this to be available in the future, then please consider to submit this as an idea under PowerApps idea forum:

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

    Regards

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,011 Most Valuable Professional

Leaderboard
Loading started