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 Apps / Display SharePoint Lis...
Power Apps
Unanswered

Display SharePoint List Attachments in Power Apps | Viewer Component - Reza Dorrani Tutorial

(0) ShareShare
ReportReport
Posted on by 149
Hi all,

I've been using a document viewer component within a Power App for a year or so, to display SharePoint list attachments. It was built using Reza's guide and has been working really nicely.   
 
However, I've recently hit a bit of a snag and I'm not sure how to resolve it. A number of my colleagues have been moved from Windows 10 to Windows 11 devices. The component itself still works fine for them, but the thumbnail image of the document is no longer visible in the viewer panel.

I'm hoping someone else may have come across this issue and figured out a way to make the thumbnail image visible.
 
Thanks!
 
 
Update:
 
I now have a bit more context regarding this issue.
 
Windows 11 users are able to see the relevant thumbnail image in the document viewer for all file types except pdf, pptx, docx, ppt & doc. The thumbnail for these specific file types is obtained via a call to SharePoint in the 'Image' property of the 'AttachmentImage' element of the component (see below).
 
If( fileExtension in [ "pdf", "pptx", "docx", "ppt", "doc" ] && IsBlank(Acceleration.X), "https://XXXX.sharepoint.com/_layouts/15/getpreview.ashx?path=" & (ThisItem.AbsoluteUri) & "&resolution=6"

On Windows 10 machines this call is completed successfully with a status code of '200 OK', but on Windows 11 machines it is declined with a status code of '403 Forbidden'. 
 
It would be amazing if someone could help us understand what might be causing the call to be declined from Windows 11 machines and what we might be able to do to resolve the problem.
Categories:
I have the same question (0)
  • Matt-991599 Profile Picture
    149 on at
    I now have a bit more context regarding this issue.
     
    Windows 11 users are able to see the relevant thumbnail image in the document viewer for all file types except pdf, pptx, docx, ppt & doc. The thumbnail for these specific file types is obtained via a call to SharePoint in the 'Image' property of the 'AttachmentImage' element of the component (see below).
     
    If(
                        fileExtension in [
                            "pdf",
                            "pptx",
                            "docx",
                            "ppt",
                            "doc"
                        ] && IsBlank(Acceleration.X),
                        "https://XXXX.sharepoint.com/_layouts/15/getpreview.ashx?path=" & (ThisItem.AbsoluteUri) & "&resolution=6"
                        
      
    On Windows 10 machines this call is completed successfully with a status code of '200 OK', but on Windows 11 machines it is declined with a status code of '403 Forbidden'. 
     
    It would be amazing if someone could help us understand what might be causing the call to be declined from Windows 11 machines and what we might be able to do to resolve the problem.

    Thanks.   
  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at
    I use exactly the same code (except mine are all PDFs so the extension not checked) with Windows 11 PCs and iPads, I have a PDF icon stored in Media, so my code is
    If(
       IsBlank(Acceleration.X) || IsBlank(Location.Altitude),
       "https://XXXX.sharepoint.com/_layouts/15/getpreview.ashx?path=" & ThisItem.AbsoluteUri,
       PDFIcon
    )
    It has worked perfectly for a number of years on an Image Control inside a Gallery. I had a brief look at the video - it uses a custom component, which at times can be problematic with Power Apps version changes - so firstly, do your images show up in an Image control ?
  • Matt-991599 Profile Picture
    149 on at
    Hi @WarrenBelz

    I appreciate you taking the time to reply. Thank you.
     
    Ideally I'd like to carry on displaying the thumbnail image of the file, rather than an icon, for the file types included in the code snippet. This works perfectly for Windows 10 and Mac users. It only becomes an issue for Windows 11 users. Which makes me think it's probably not a problem caused by a version change in Power Apps.

    Something appears to be happening that results in the call to SharePoint from Windows 11 machines being declined. If I can understand what that is (a security setting for example), I can probably find someone in my company's IT team to investigate it. It's tricky finding someone to help without being able to tell them what the problem is though.
  • WarrenBelz Profile Picture
    153,049 Most Valuable Professional on at
    It may be something internal in your company - all I can offer is that the code works perfectly on two different customers of mine on Windows 11 PCs on Image controls.
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Have you tried navigating to the SharePoint site in browser on the machine with the users' permissions to see if it refuses the connection?
  • Verified answer
    Matt-991599 Profile Picture
    149 on at
    Hi @ronaldwalcott & @WarrenBelz

    We figured it out in the end. Some of of our Windows 11 machines had been built without cookies being auto allowed in the browser settings. This was resulting in the call to SharePoint being declined.
     
    We manually added the SharePoint address to the 'Allow' list on the impacted users' machines and it resolved the problem. 
     
    Thanks for your advice/support. It was much appreciated.  

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard