PowerApps PDF Viewer SharePoint Document Library without flow
Table of Contents
Introduction
This tutorial provides a step-by-step guide on how to utilize the PDF Viewer control in Power Apps to display PDF files and Office documents (Word, PowerPoint, Excel) from a SharePoint Document Library without relying on Power Automate flows. This method leverages the API to convert Office documents into PDFs and effectively showcases document previews.
Step 1: Set Up Your SharePoint Document Library
- Navigate to your SharePoint site.
- Create a new document library or select an existing one.
- Upload your PDF and Office documents (Word, PowerPoint, Excel) into the library.
- Ensure that these documents are accessible to your Power Apps application.
Step 2: Create a Power App
- Open Power Apps and create a new app.
- Choose the layout that best suits your needs (canvas or model-driven).
- Connect your app to the SharePoint Document Library:
- Go to the "Data" section.
- Select "Add Data" and choose SharePoint.
- Enter your SharePoint site URL and select the document library.
Step 3: Display Thumbnails of Documents
- Insert an Image control into your app.
- Set the Image property to display document thumbnails:
ThisItem.'{Thumbnail}'.Url - This will show a preview of each document in the gallery or list.
Step 4: Use PDF Viewer Control for Office Documents
- Insert a PDF Viewer control into your app.
- Set the Document property of the PDF Viewer to convert and display documents:
If(ThisItem.FileType = "application/pdf", ThisItem.'{Link to document}', "https://docs.google.com/gview?url=" & ThisItem.'{Link to document}' & "&embedded=true") - This formula checks if the selected document is a PDF; if not, it uses Google Docs Viewer to render other document types.
Step 5: Show PDF Files from SharePoint
- To specifically display PDF files, ensure the PDF Viewer control's Document property is set to the PDF file URL:
ThisItem.'{Link to document}' - This will allow users to view PDF files directly within your Power App.
Conclusion
In this tutorial, you have learned how to set up a SharePoint Document Library and use the Power Apps PDF Viewer control to display various document types without the need for Power Automate. By following these steps, you can create an interactive app that enhances document accessibility and user experience. As a next step, consider adding features like search functionality or document metadata display to further enhance your app.