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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Displaying Attachments...
Power Apps
Answered

Displaying Attachments in Image Controls - Not working for some users.

(0) ShareShare
ReportReport
Posted on by 232

Hi All,

 

I have 10 image controls in my form, each of which are connected to a flow that saves the image that is added by a user into the attachments of the connected Sharepoint List item.

These attachments are saved as Image001.jpg, Image002.jpg, etc.

This is set up this way as it was imperative that a) the images are placed into the attachment area of a list item, and b) each attachment had to be named with exactly this naming convention for future flow runs that occur later on in our workflow.

 

All of this works perfectly fine.

 

The issue I'm having is displaying the correct thumbnails after a user saves their form, exits, and comes back to edit the form later on.

 

Previously, I was using a formula a "Last(FirstN" formula, and picking an image count this way, however this would erroneously display the image control thumbnail above if no image was uploaded into it. (If a user uploaded an image into Image Control 1, this same thumbnail would be repeated in Image Control 2 if no image was uploaded into Image control 2).

This obviously caused a lot of confusion for users.

 

So next I tried a direct url link to the appropriate image "https://*************************/Lists/****/Attachments/"& ThisItem.ID &"/Image003.jpg"

 

This worked fine as the image names were always the same, and I could dynamically point the app to the Item ID of the selected list item.

On my PC, using a Chrome Web Browser, this method still works perfectly fine.

On other users PC's using a Chrome or Edge Browser, the image thumbnails do not display at all.

 

I've tried collecting the AbsoluteUri of attachments when a given form is loaded, but I can't work out a way to then display them in an image control.

 

Has anyone figured out a fully functioning way of displaying attachments in image controls?

 

For reference, here are images of the respective controls and code snippets of the formulas.

The Uploaded Image Control 'Image' Property for Image001.jpg:

If(IsBlank(AddMediaButton2.Media), "https://northeastmedia.sharepoint.com/sites/NEMNewsroom2/Lists/Acta/Attachments/"& ThisItem.ID &"/Image001.jpg", AddMediaButton2.Media)

 

(Substitute Image002.jpg, Image003.jpg, etc for each subsequent image control).

 

An example of the Image controls. Using my computer - the images are displaying correctly.An example of the Image controls. Using my computer - the images are displaying correctly.

Example above of the correct images displaying in the respective controls.

 

Example of the image controls not workingExample of the image controls not working

 

Example above of the image controls for the same list item not working on another user's PC.

 

The corresponding list item in SharepointThe corresponding list item in Sharepoint

The corresponding list item in Sharepoint.

 

As I say, the images are always called Image001.jpg - > Image010.jpg for every list item.

I'm thinking there must be an easy way to do this, but I just can't get it working right.

 

Cheers in advance for any advice!

 

Chris,

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    Hi @cfebvre ,

    I will answer your second question first - below is some random photos in Image controls in a gallery from my test app.

    The Gallery Items are simply

    AttachmentControlName.Attachments

    The Image is 

    ThisItem.Value

    A single image control is

    GalleryName.Selected.Value

    If this suits you and you have further questions, happy to assist.

    AttachmentImage.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up

     

     

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @cfebvre ,

    Have you shared your SP List to your end users?

    Do you mean that the Attachments image could only displayed on your PC rather than others?

     

    Please make sure you have shared your SP List to your end users properly. As an alternative solution, please consider add a Gallery (Image Layout), set the Items property to following:

    ThisItem.Attachments

    set the Image property of the Image control within the Gallery to following:

    ThisItem.Value

     

    Please take a try with above solution, check if the issue is solved.

     

    Best regards,

  • cfebvre Profile Picture
    232 on at

    Thanks Kris,

     

    I have shared the Sharepoint list with all users, however I was just watching a powerapps tutorial today where it was mentioned that using a url to a sharepoint attachment is a bad method as users must be logged into sharepoint specifically, otherwise the control will appear blank, irrespective of whether the list is shared with them or not.

     

    I believe this is what is happening in my case.

     

    I'm afraid a gallery won't work in my specific case as it's not how I need the app to function.

     

    I have, however, built a collection (using ClearCollect) that is grabbing the 'value' of all attachments when a user edits a form:

    ClearCollect(StoryImages, ThisItem.'{Attachments}'.Value);

     

    And I'm now correctly displaying the first attachment in the first image control with:

    First(StoryImages.Value).Value

     

    But I can't figure out how to grab the 2nd, 3rd, 4th specific records (etc) for the corresponding 2nd, 3rd, and 4th Image controls (etc).

     

    I know there is a formula that uses a combination of 'First(LastN' and then a digit, but I can't remember the specific formula.

    Are you able to assist with this?

     

    Cheers in advance!

     

    Chris

     

     

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    Firstly @v-xida-msft , thanks for confirming the content of my post.

    @cfebvre please tag me if you to share what I do in this space.

  • cfebvre Profile Picture
    232 on at

    Hi Warren @WarrenBelz ,

     

    Thanks for the response, apologies I hadn't got to responding to you yet.

     

    I am aware of the Gallery method of displaying attachments, however it's not something I can use in my specific case.

    The image controls and adjacent caption fields are not contained in a nested gallery, they are their own fields in the form users fill out.

     

    I unfortunately need to set things up this way as each image control calls a specific flow (which renames the images prior to them being attached to the list item).

     

    Additionally, each list item has a varying amount of images, and I need users to be able to add and remove these individual controls as the need arises and I think a nested gallery just doesn't cut the mustard in this regard - I do use them in other solutions I have set up, though.

     

    Cheers!

  • WarrenBelz Profile Picture
    156,100 Most Valuable Professional on at

    Thanks @cfebvre ,

    I understand - your path is not something I do due to having other options that suit our requirements.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @cfebvre ,

    Do you not want to display your images within the Gallery?

    Do you want to display these images using separated Image control in your app?

     

    If you want to display these images using separated Image control in your app, please take a try with the following workaround:

    For Image1:

    Set Image property to following:

    Last(FirstN(StoryImages.Value, 1)).Value

    For Image2:

    Set Image property to following:

     

    Last(FirstN(StoryImages.Value, 2)).Value

     

    For Image3:

    Set Image property to following:

     

    Last(FirstN(StoryImages.Value, 3)).Value

     

    For Image4:

    Set Image property to following:

     

    Last(FirstN(StoryImages.Value, 4)).Value

     

    Please take a try with above solution, check if the issue is solved.

     

    Best regards,

     

  • cfebvre Profile Picture
    232 on at

    @v-xida-msft Thanks Kris,

     

    This does work, however I still run into the issue of duplicate thumbnails in image controls using the 'Last(FirstN' method.

    It'll keep the app functioning for now, but I'll need to devise a better method.

     

    Cheers,

     

    Chris.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard