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 Pages / Displaying an image of...
Power Pages
Unanswered

Displaying an image of type file in Portal page

(0) ShareShare
ReportReport
Posted on by

Hi all,


I have created a new field called 'gw_image' of type 'file -> image' and set the option 'can store full image' to be true.

 

I wondered if there was a way to display this using FetchXML? Everything I have tried has not worked.

 

 

<fetch>
 <entity name="gw_onlineresources">
 <attribute name="gw_onlineresourcesid" />
 <attribute name="gw_image" />
 <order attribute="gw_name" descending="false" />
 </entity>
</fetch>

{% for result in onlineresources.results.entities %}
 {{ result.gw_image }}
 {{ result.gw_image.Type }}
 {{ result.gw_image.Size }}
 {{ result.gw_image.Url }}
 {{ result.gw_image.Value }}
{% endfor %} 

 

 

If the FetchXML method is not an option, I could maybe use the Image URL. From my little attempts thus far, I cannot seem to get it to display the full image (only a tiny thumbnail version) - despite setting full=true

 

 

/Image/download.aspx?Entity=xxx&Attribute=xxx&Id=xxx&Full=true

 

 

https://learn.microsoft.com/en-us/power-pages/configure/image-column

 

Any help much appreciated!

Categories:
I have the same question (0)
  • h4x0rz3d Profile Picture
    8 on at

    @OliverRodriguesany ideas?

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi, this worked fine for me:

    OliverRodrigues_0-1710077637132.png

     

    Can you share the full code as I think you shared snippets from different places, this is my code working fine:

    {% fetchxml accounts %}
     <fetch>
     <entity name="account">
     <attribute name="accountid" />
     <attribute name="ollie_accountimage" />
     </entity>
     </fetch>
    {% endfetchxml %}
    
    {% for result in accounts.results.entities %}
     <p>Account ID: {{ result.accountid }}</p>
     <p>Image Column Type: {{ result.ollie_accountimage.Type }}</p>
     <p>Image Size: {{ result.ollie_accountimage.Size }}</p>
     <p>Image URL: {{ result.ollie_accountimage.Url }}</p>
     <p>Image Base64: {{ result.ollie_accountimage.Value }}</p>
     <p>==========================================================</p>
    {% endfor %} 
  • GWham1 Profile Picture
    on at

    @OliverRodrigues That's a little strange.

     

    I just can't seem to get any results for gw_image at all. I wondered if it was due to it being a custom table? 🙄

     

    Did you create your column as the same type as the below?

     

    GWham1_1-1710099302385.png

     

     

     

     {% fetchxml onlineresourcesquery %}
     <fetch>
     <entity name="gw_onlineresources">
     <attribute name="gw_onlineresourcesid" />
     <attribute name="gw_name" />
     <attribute name="gw_image" />
     <attribute name="gw_imageid" />
     </entity>
     </fetch>
     {% endfetchxml %}
    
     {% for result in onlineresourcesquery.results.entities %}
     <p>Online Resource ID: {{ result.gw_onlineresourcesid }}</p>
     <p>Online Resource Name: {{ result.gw_name }}</p>
     <p>Online Resource Image ID: {{ result.gw_imageid }}</p>
     <p>Image Column Type: {{ result.gw_image.Type }}</p>
     <p>Image Size: {{ result.gw_image.Size }}</p>
     <p>Image URL: {{ result.gw_image.Url }}</p>
     <p>Image Base64: {{ result.gw_image.Value }}</p>
     <p>==========================================================</p>
     {% endfor %} 

     

     

     

    GWham1_5-1710099752715.png

     

    GWham1_4-1710099572354.png

    GWham1_0-1710101278061.png

     

  • GWham1 Profile Picture
    on at

    @OliverRodriguesOne last thing i can think of is the enhanced data model. Are you using that?

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    I am using the enhanced data model, but in this particular scenario I am not using the record Picture, I am using a custom attribute with the Type = Image, I thought this was what you were doing as well

     

    I have used the record picture within the Contact, I can try in a custom table if the above scenario doesn't suit you


    When creating the new column, select Image as Data Type:

    OliverRodrigues_0-1710148845453.png

     

     

  • GWham1 Profile Picture
    on at

    @OliverRodrigues That's the same as I have done. I also created a field on an out the box table for 'account' and the same problem existed for me. I noticed If you create a column as data type 'Image' it changes it to become 'Single line of text' when previewing/editing the column (for some reason), but displays as an 'image' in the column table. I'm assuming you get the same behaviour?

    GWham1_1-1710149100498.png

     

    I also created another column called 'gw_resourceimage' as noticed mine was set as default picture (which I did not select upon creation), but still having the same issue.

     

    GWham1_2-1710149462910.png

     

    GWham1_3-1710149528535.png

     

    GWham1_4-1710149547084.png

     

    GWham1_5-1710149713183.png

    I am on portal version 9.6.1.26 are you on the same?

    GWham1_0-1710150002338.png

     

     

  • dalemb Profile Picture
    42 on at

    Hi @GWham1 ,

     

    I faced the same issue as you 2 weeks ago, raised a Microsoft ticket and they have no solution for this. The enhanced data model has issues, that's for sure. And the online help is confusing or not helping.

     

    I found a way to solve that, you need to adapt the following code:

     

    <img src="https://AA-AAAAA.powerappsportals.com/Image/download.aspx?Entity=bsda_standardconfig&Attribute=bsda_imagepresentation1&Id={{listItem_z2.bsda_associatedstandardconfigidfortheimages}}&full=true" />
     
    AA-AAAAA
    Replace that with your portal URL
     
    bsda_standardconfig
    Replace that with your table logic name
     
    bsda_imagepresentation1
    replace that with your image column of that table (file type image)
     
    Now, the important part:
    {{listItem_z2.bsda_associatedstandardconfigidfortheimages}}
     
    That's the fetch result, unique guid for that specific row (where the image is located)
    Replace with your fetch. 
     
    Cheers,
     
  • GWham1 Profile Picture
    on at

    @DaleThanks, I was trying to avoid using the Image URL but seems like this is the only method for the time being. That works fine, as you suggested. Strange how @OliverRodrigues got the above working. There must be some issues somewhere along the road - maybe he is running a different version?

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    "I noticed If you create a column as data type 'Image' it changes it to become 'Single line of text' when previewing/editing the column (for some reason), but displays as an 'image' in the column table. I'm assuming you get the same behaviour?"

     

    Yes I am getting the same behaviour, it seems to be a wider bug on the Power Platform.

     

    My Portal version is Portals 9.6.2.6

    not sure if it's related to that

     

  • GWham1 Profile Picture
    on at

    @OliverRodriguesI'm assuming you're on early upgrade? I could try that to rule it out. I'm assuming, I just need to wait around until that updates? Is there a quicker way to force it to update?

    GWham1_0-1710160032529.png

     

     

     

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 Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard