You are currently viewing PowerApps document viewer: View Word, Excel, PDF & PowerPoint Files In Power Apps

PowerApps document viewer: View Word, Excel, PDF & PowerPoint Files In Power Apps

In this article, we will create PowerApps document viewer app to learn how PowerApps view documents from the SharePoint document library.

We will learn,

  • The PowerApps PowerPoint viewer
  • The PowerApps pdf viewer
  • The PowerApps word document viewer
  • The PowerApps Excel viewer

PowerApps document viewer

In this app, we will work with a SharePoint document library that will contain documents of PowerPoint, pdf, word, and excel types, when the user selects a file from a list it opens to show the full document on the right-side of the app.

Prepaire Sharepoint document library

  1. Create SharePoint document library
  1. Upload samples of the diffrent document types that we will use in the Power Apps Document Viewer App.
powerapps sharepoint document library
Power Apps SharePoint document library

Create the PowerApps Document Viewer Canvas App

  1. From the make site , create a Canvas app with tablet formate and name it PowerApps documents viewer app.
  2. Add the SharePoint Document Library that we create to the app as a datasource.
    1. from the view menu
    2. Add data
    3. search for Sharepoint connector
    4. Add a connection
    5. Type the URL of your SharePoint Site
    6. Choose the document viewer list
    7. Insert a gallery and assign the sharepoint document viewer as a data source
  1. Insert Alabel and Image in the gallery
  2. set the lable text property to show the file name and its extension
ThisItem.'File name with extension'
powerapps document viewer
PowerApps Document Viewer Canvas App
  1. In the Image property of the gallery you can set the image accourding to the document type
    • You can use the Free PowerApps Icons to set the images of the doument
    • search for the document type and get the power apps Code as shown below
powerapps document viewer icons
Free PowerApps site
  1. so in our case the formula for the image property in the gallery will be as shown bellow,

// pdf icon
    EndsWith(ThisItem.'File name with extension', "pdf"),
    // Word icon
    EndsWith(ThisItem.'File name with extension', "docx"),

    // Excel icon
    EndsWith(ThisItem.'File name with extension', "xlsx"),
    // PowerPoint icon
    EndsWith(ThisItem.'File name with extension', "pptx"),

    // Other filetype icon,

Actually we will use The Power Apps PDF viewer to display also a Word, Excel or PowerPoint document in Power Apps canvas app.

  1. In the right side of the app insert the PDF viewer
    1. from the Media menu
    2. select PDF viewer
PowerApps pdf viewer
PowerApps PDF viewer

To use PowerApps pdf viewer to view the other document type , we have convert the docx, xlsx or pptx files to a pdf first

Now we will know how PowerApps view any document like Excel, Word, PowerPoint,etc

Not for PDF we will add another code for PDF files

Convert Documents to pdf in Power Apps

All we have to do is a single line code that we will apply on the document property of the pdf viewer that we inserted in our PowerApps canvas app.

  • So in Document property type this formula that shown below.

When we select the thumbnail of a Word, Excel or PowerPoint file from the gallery ,It returns the web address for the SharePoint API, which will provide an image. This API converts a docx file into a thumbnail image as shown bellow.

5 | Power Platform Geeks
Convert Documents to pdf in Power Apps

PowerApps pdf viewer


Show text, graphics, and other content in a PDF file by adding this type of control and setting its Document property to the URL, enclosed in double quotation marks, of the file that you want to show.


The PDF Viewer must only handle HTTPS links, not HTTP, due to the security architecture of Power Apps.

The Document attribute must point to the PDF file directly. Server redirection and HTML document views are not supported.

The document’s hosting server should not require authentication.

If a PDF document is stored on a server with restrictive cross-origin resource sharing (CORS) settings, you may not be able to read it in your app. To fix the problem, the PDF document server must allow cross-origin requests from

How to view PDF in PowerApps?

You can view Power apps PDF using flow but here I will show you how PowerApps view PDF from SharePoint without flow

All we have to do for our previous formula is to update the formula and check if the file is pdf then pass the full URL for the pdf file to the PowerApps pdf viewer

If( EndsWith(Gallery1.Selected.'File name with extension', "pdf"),
Gallery1.Selected.'Link to item',

Gallery1.Selected.’Link to item‘ will get the full URL for the pdf file in the SharePoint including HTTPS.

some times you can able to view the Pdf file in the app but you can show the pdf file in the browser instead.


We can use the PDF viewer in PowerApps to show PDF, Word, Excel, PowerPoint, or any type of document.

See Also

Heba Kamal

Power Platform Consultant and Founder of Power Platform Geeks