The Secret Way To View Word, Excel & PowerPoint Files In Power Apps
Power Apps has a secret Word, Excel and PowerPoint document viewer hiding in plain sight. It’s actually the PDF viewer. No, the PDF viewer can’t do this by default. But with one-line of code you can use Power Apps PDF viewer to show docx, xlsx, and pptx files instead of pdf files. It is very easy to implement. You just have to know how to do it.
Table Of Contents:
• Introduction: Document Viewer App
• Setup The SharePoint Document Library
• Create A List Of Word, Excel and PowerPoint Files
• Display Word, Excel and PowerPoint Icons
• Add The PDF Viewer Control To The App
• Convert Word, Excel and PowerPoint Files Into A PDF
• How Does The Word, Excel & PowerPoint to PDF Conversion Work?
Introduction: Document Viewer App
Employees at an animal hospital user the Document Viewer app to look at Word (docx), Excel (xlsx) and PowerPoint files (pptx). When the employee selects a file from a list it opens to show the full document on the right-side of the app.
Setup The SharePoint Document Library
Create a new SharePoint document library called Document Viewer one of each filetype:
- Word (docx)
- Excel (xlsx)
- PowerPoint (pptx)
- Another filetype not found in the list above
Create A List Of Word, Excel and PowerPoint Files
Open Power App Studio and create a new tablet app from blank. Insert a label at the top of the screen with the text “Document Viewer” to act as titlebar. Then add the Document Viewer SharePoint Document Library to the app as a datasource.
Make a new blank vertical gallery and position it on the left-side of the screen. Choose Document Viewer as the datasource.
This code will appear in the Items property of the gallery.
'Document Viewer'
Next, we will update the style of the gallery.
Use this code in each of these properties in the gallery to achieve the same style as shown in the image above.
Fill: RGBA(237, 237, 237, 1)
TemplateFill: If(ThisItem.IsSelected, ColorFade(LightSkyBlue, 70%), White)
TemplatePadding: 8
TemplateSize: 80
Then create 2 new labels and insert them into the gallery.
Write this code in the Text property of the labels to show the document name and the last modified date.
ThisItem.Name
ThisItem.Modified
Display Word, Excel and PowerPoint Icons
To make a better looking file explorer we will place an icon beside each filename in the list. Insert a new Image into the gallery and place it on the left-side of the row.
Then we will create the icons Word, Excel and PowerPoint icons with some SVG code.
Copy and paste this long code block into the Image property of the Image. The EndsWith function checks the file extension at the end of the filename. Then it uses the SVG code from this free Power Apps Icon Set to draw the icon.
If(
// Word icon
EndsWith(ThisItem.'File name with extension', "docx"),
"data:image/svg+xml;utf8, %3Csvg%20%20viewBox%3D%270%200%202048%202048%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%3Cpath%20d%3D%27M2048%20475v1445q0%2027-10%2050t-27%2040-41%2028-50%2010H640q-27%200-50-10t-40-27-28-41-10-50v-256H115q-24%200-44-9t-37-25-25-36-9-45V627q0-24%209-44t25-37%2036-25%2045-9h397V128q0-27%2010-50t27-40%2041-28%2050-10h933q26%200%2049%209t42%2028l347%20347q18%2018%2027%2041t10%2050zm-384-256v165h165l-165-165zM320%201424h161q2-8%209-43t18-83%2021-103%2022-101%2016-76%208-31l7%2030q7%2030%2017%2077t23%20100%2023%20103%2019%2084%2010%2043h160l148-672H834l-80%20438-100-438H502l-96%20440-86-440H170l150%20672zm320%20496h1280V512h-256q-27%200-50-10t-40-27-28-41-10-50V128H640v384h397q24%200%2044%209t37%2025%2025%2036%209%2045v922q0%2024-9%2044t-25%2037-36%2025-45%209H640v256zm640-1024V768h512v128h-512zm0%20256v-128h512v128h-512zm0%20256v-128h512v128h-512z%27%20fill%3D%27%230078d4%27%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
// Excel icon
EndsWith(ThisItem.'File name with extension', "xlsx"),
"data:image/svg+xml;utf8, %3Csvg%20%20viewBox%3D%270%200%202048%202048%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%3Cpath%20d%3D%27M2048%20475v1445q0%2027-10%2050t-27%2040-41%2028-50%2010H640q-27%200-50-10t-40-27-28-41-10-50v-256H115q-24%200-44-9t-37-25-25-36-9-45V627q0-24%209-44t25-37%2036-25%2045-9h397V128q0-27%2010-50t27-40%2041-28%2050-10h933q26%200%2049%209t42%2028l347%20347q18%2018%2027%2041t10%2050zm-384-256v165h165l-165-165zM261%201424h189q2-4%2012-23t25-45%2029-55%2029-53%2023-41%2010-17q27%2059%2060%20118t65%20116h187l-209-339%20205-333H707q-31%2057-60%20114t-63%20112q-29-57-57-113t-57-113H279l199%20335-217%20337zm379%20496h1280V512h-256q-27%200-50-10t-40-27-28-41-10-50V128H640v384h397q24%200%2044%209t37%2025%2025%2036%209%2045v922q0%2024-9%2044t-25%2037-36%2025-45%209H640v256zm640-1024V768h512v128h-512zm0%20256v-128h512v128h-512zm0%20256v-128h512v128h-512z%27%20fill%3D%27%230b6a0b%27%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
// PowerPoint icon
EndsWith(ThisItem.'File name with extension', "pptx"),
"data:image/svg+xml;utf8, %3Csvg%20%20viewBox%3D%270%200%202048%202048%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%3Cpath%20d%3D%27M2048%20475v1445q0%2027-10%2050t-27%2040-41%2028-50%2010H640q-27%200-50-10t-40-27-28-41-10-50v-256H115q-24%200-44-9t-37-25-25-36-9-45V627q0-24%209-44t25-37%2036-25%2045-9h397V128q0-27%2010-50t27-40%2041-28%2050-10h933q26%200%2049%209t42%2028l347%20347q18%2018%2027%2041t10%2050zm-384-256v165h165l-165-165zM368%20752v672h150v-226h100q52%200%2097-15t78-46%2053-72%2020-97q0-56-17-97t-50-67-76-39-97-13H368zm1552%201168V512h-256q-27%200-50-10t-40-27-28-41-10-50V128H640v384h397q24%200%2044%209t37%2025%2025%2036%209%2045v922q0%2024-9%2044t-25%2037-36%2025-45%209H640v256h1280zM1536%20640q79%200%20149%2030t122%2082%2083%20123%2030%20149h-384V640zm-128%20128v384h384q0%2080-30%20149t-82%20122-123%2083-149%2030q-33%200-65-6t-63-18V792q31-11%2063-17t65-7zm-804%20300h-86V883h90q47%200%2074%2020t27%2070q0%2052-28%2073t-77%2022z%27%20fill%3D%27%23ca5010%27%3E%3C%2Fpath%3E%3C%2Fsvg%3E",
// Other filetype icon,
"data:image/svg+xml;utf8, %3Csvg%20%20viewBox%3D%270%200%202048%202048%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%3Cpath%20d%3D%27M1243%200l549%20549v1499H128V0h1115zm37%20219v293h293l-293-293zM256%201920h1408V640h-512V128H256v1792zm256-896V896h896v128H512zm0%20256v-128h896v128H512zm0%20256v-128h896v128H512z%27%20fill%3D%27%237a7574%27%3E%3C%2Fpath%3E%3C%2Fsvg%3E"
)
Add The PDF Viewer Control To The App
Now that we’ve got a list of PDF files to open the next step is to add a pdf viewer control to the app.
Place the PDF viewer so it fills right-side of the screen. It will display Lorem Ipsum text until we supply a it with a Word, Excel or PowerPoint file.
Convert Word, Excel and PowerPoint Files Into A PDF
We will use the PDF viewer to display a Word, Excel or PowerPoint document instead. To do this we must convert the docx, xlsx or pptx file to a pdf. This task can be accomplished in Power Apps with only one-line of code.
Write this code in the Document property of the PDF viewer.
Substitute(
gal_Files.Selected.Thumbnail.Large,
"/thumbnail",
"/pdf"
)
The Document Viewer app is now completed. The app should work as shown below.
How Does The Word, Excel & PowerPoint to PDF Conversion Work?
When we select the thumbnail of a Word, Excel or PowerPoint file from the gallery like this it does not directly return an image.
gal_Files.Selected.Thumbnail.Large
Instead, it returns the SharePoint API web address that will return an image. This API transforms a docx file into into a thumbnail. Take a look a the code below to see where the words docx and thumbnail appear.
https://canadaeast1-mediap.svc.ms/transform/thumbnail?provider=spo&inputFormat=docx&cs=fFNQTw&docid=https%3a%2f%2fmatthewdevaney.sharepoint.com%3a443%2f_api%2fv2.0%2fdrives%2fb!89APnJ4x-k-YpcmiIGM7DWa2IOP7EHdFgNmlF2w7ov02wz2jjypdQpx3wlFp16fq%2fitems%2f0173OPFMNJ7V2QPX3XZRD3TATVOWZDLI6T%3fversion%3dPublished&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvbWF0dGhld2RldmFuZXkuc2hhcmVwb2ludC5jb21AZjFiOGI1MDktNTBhNC00YTVjLThlNDgtYmYzZDNlN2MxMGVkIiwiaXNzIjoiMDAwMDAwMDMtMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwIiwibmJmIjoiMTY0MTI1NDQwMCIsImV4cCI6IjE2NDEyNzYwMDAiLCJlbmRwb2ludHVybCI6InJIaGQ3dXhZaTloblpSZWVYbFNJRlRWNDJpaExucjIxMWN2dk5VbHlWR009IiwiZW5kcG9pbnR1cmxMZW5ndGgiOiIxMjEiLCJpc2xvb3BiYWNrIjoiVHJ1ZSIsInZlciI6Imhhc2hlZHByb29mdG9rZW4iLCJzaXRlaWQiOiJPV013Wm1Rd1pqTXRNekU1WlMwMFptWmhMVGs0WVRVdFl6bGhNakl3TmpNellqQmsiLCJhcHBfZGlzcGxheW5hbWUiOiJBcHAgU2VydmljZSIsImdpdmVuX25hbWUiOiJNYXR0aGV3IiwiZmFtaWx5X25hbWUiOiJEZXZhbmV5IiwibmFtZWlkIjoiMCMuZnxtZW1iZXJzaGlwfG1kQG1hdHRoZXdkZXZhbmV5LmNvbSIsIm5paSI6Im1pY3Jvc29mdC5zaGFyZXBvaW50IiwiaXN1c2VyIjoidHJ1ZSIsImNhY2hla2V5IjoiMGguZnxtZW1iZXJzaGlwfDEwMDMyMDAwOGI5M2RhNTBAbGl2ZS5jb20iLCJzaGFyaW5naWQiOiI1NmNiY2I0MS04MTU5LTRjOTMtOGU1ZS1lNzA2YzBkN2E5NTQiLCJ0dCI6IjAiLCJ1c2VQZXJzaXN0ZW50Q29va2llIjpudWxsLCJpcGFkZHIiOiI0MC44NS4yMDYuOTUifQ.Z29OaGh4OXRVZUFwbU8xVXh0OEZaNk9yWG5rQ3F6SVhDaHVNcEt4ZFdFaz0&width=800&height=800
But wait a minute, we need it to return a pdf instead. Using the Substitute function we change the word thumbnail to pdf. Now the API will change the docx into a pdf and we can display it in the PDF Viewer.
https://canadaeast1-mediap.svc.ms/transform/pdf?provider=spo&inputFormat=docx&cs=fFNQTw&docid=https%3a%2f%2fmatthewdeva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A2YzBkN2E5NTQiLCJ0dCI6IjAiLCJ1c2VQZXJzaXN0ZW50Q29va2llIjpudWxsLCJpcGFkZHIiOiI0MC44NS4yMDYuOTUifQ.Z29OaGh4OXRVZUFwbU8xVXh0OEZaNk9yWG5rQ3F6SVhDaHVNcEt4ZFdFaz0&width=800&height=800
That’s how the magic works!
Did You Enjoy This Article? 😺
Subscribe to get new Power Apps articles sent to your inbox each week for FREE
Questions?
If you have any questions about The Secret Way To View Word, Excel PowerPoint Files In Power Apps please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.
This is a great workaround with SharePoint. I do not use SharePoint. How can we do this using Dataverse?
Manish,
For Dataverse we have two known options but neither is as slick as SharePoint:
1. We can create a flow to convert the Word document to PDF and store it alongside the original file. It could be automated to create a new PDF each time a Word file is added or changed. Not my favorite solution but it works.
2. My colleague Vivek Bavishi came up with a very neat solution you should look into. He managed to link a Dataverse to a SharePoint document library and serve files from there. It was done to avoid the 2GB database limit in Dataverse for Teams. However, you could apply it to achieve your goals of viewing documents in Power Apps as well.
Link to Vivek’s YouTube video: https://m.youtube.com/watch?v=_vKzIy4jF8c
Thanks for your response and the link. I could attempt to take what Vivek demoed little further. My fear is, that such workaround is not sustainable for a serious app with multiple personas. I only hope and wish PA team comes up with Office viewer control.
Thank you again. I really enjoy your posts.
Great, thanks!
Will this work with sharepoint attachments?
Hi Matthew,
I tested this option in December but it doesn’t work 🙁
PDFViwer show only “Couldn’t open PDF file. Open in my browser instead”.
Open in browser also doesn’t work and shows error:
Example generation link:
https://northeurope1-mediap.svc.ms/transform/pdf?provider=spo&inputFormat=pdf&cs=fFNQTw&docid=https%3a%2f%2feuropasystems.sharepoint.com%3a443%2f_api%2fv2.0%2fdrives%2fb!bdAKQUXUEU2GDQyNmH3VY477j2TAMTlOmV4ZhYSGvtSk-9v4D45KRJ–Civ5HHzT%2fitems%2f01GS25KWRGXMZJZAKIUJAICSHQTQESA2MT%3fversion%3dPublished&access_token=eyJ0eXAiOiJKV1Q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b2J0ejBNTmVTbTVJS2ZZeTQxMD0&width=800&height=800
You can help?
Sylwester,
In the screenshot it looks like you are trying to open a PDF. This article is about how to open DOCX, XLSX and PPTX files. Opening a PDF in a document library requires a totally different process.
I will be posted an article on how to open a PDF in a SharePoint Document library and view it inside Power Apps next week. You can subscribe to email list and have it sent directly to your inbox once its published 🙂
Yes, I am trying to open a PDF.
I saw your technique also used for PDF (https://youtu.be/vqK29FWbLxU) so I tried 🙂
Thanks for information about article.
I’m looking forward 🙂
Hi Matthew,
Hhen can the article about pdf be expected? 🙂
Sylwester,
This month. I’ve already written the article. Just a few more ahead of it in the publishing schedule 😉
Hi Matthew,
Thanks for this great tutorial! I’m a amateur in PowerApps, so this was helpful.
I’m aiming to display a library of Excel files in a PowerApp using this technique, but I am receiving the same error as above. Would you be able to take a look at this error code:
Thank you!
Evan,
Hmmmm, I have not encountered this before. In the document property of the PDF viewer what code are you using? Can you share the result of that code? It’s the code where I use the SUBSTITUTE formula.
Hello Matthew, I am getting the same error as Evan for one Excel file, while others are opening successfully using your Substitute code. Could the problem be the part reading “XLSPageLimitExceeded”? The one that does not open is a much larger Excel sheet than the others.
I have a gallery where the document is selected on one screen, and the PDF viewer on another screen. The user clicks a PDF icon in the gallery to view the document. The icon’s OnSelect code is:
Set(varSelectedDocTracker, Substitute(gal_TrackerSearch.Selected.Thumbnail.Large, “/thumbnail”,”/pdf”)); Navigate(‘Tracker File Viewer’,ScreenTransition.Fade)
and the code in the PDF viewer is simply:
varSelectedDocTracker
Any insight you can provide is much appreciated!
You probably have an empty (no content) Excel file. Try to edit the file and write anything in it, then use the PDF viewer.
This raises another question for Mat, how can we avoid it. How can we check if a file has no content?
Hi Matthew,
Great article and thanks for sharing your knowledge.
Do you know if the transform option can have a policy within an organization?
I have tried to convert a file by replacing thumbnail for pdf in the items url.
This only seem to work for word but not for excel for instance.
I would also like to know if you have tried to host this file explorer in a model driven variant and make use of dynamic values to start browsing the sharepoint folder.
To my knowledge the success of this experience is mostly dependent on how the sharepoint site is structured. You need to have root folder for the most optimum experience, correct?
BR Rob
Rob,
Great questions, but I’m not sure I have the answers for any of them. I haven’t experienced any issue with policies or root folder access and the Excel file conversion worked well on my-side. I wish I could be of more help but without being on your site its hard to troubleshoot 🙁
Hi Matthew,
Can I know whether there any way to download the excel file in addition to viewing the file from sharepoint document library.
Thanks,
Pavan
Pavan,
You can use the ‘File path’ field in a DOWNLOAD function to get the file.
Thanks Matthew for the suggestion the file path is working well in Google Chrome and Mozzilla but when I try downloading in Microsoft Edge it is directly opening the Excel file which is residing in Sharepoint in my Microsoft Excel Desktop Application.
Hey Matthew, how would I go about using this but the the folder inside document viewer for instance is dictated by an item selected in gallery?
If I click Alex in gallery for example, it opens document viewer/alex folder?
Alex,
This article will help you to understand how navigating SharePoint Document Libraries in Power Apps works:
https://www.matthewdevaney.com/power-apps-navigating-folders-subfolders-in-a-sharepoint-document-library/
Hello this is great. Eny ideas why thumbnails does not refresh even if i manually refresh library from app?
Damian,
Sorry, I have not encountered this issue before. Not sure how to reproduce it.
Ok sorry about that. I have added an “Edit” button to this gallery to allow the user to edit the file. Everything works fine, but it didn’t refresh the thumbnail. I’ve already found an ugly way to fix this by adding the string “a” after making any changes to the document, and it works, but maybe there is another way to do it.
varPDFrefresh is a variable with “a” constantly being added when the file is edited
I’ve add an Icon : OnSelect – Refresh(yourGallery)
hi, How refreshing a Gallery? Refresh only works on Datasources…
I have the same problem the Thumbnail doesn’t change/updates when the document is modified, so the PdfViewer shows an old version of the document.
Adding a character as proposed by Damian it only works once, when the app is modified to add it. Then if the Doc is changed again the pdfViewer doesn’t show the changes.
Hi, Did you find a solution for this at all?
I have the PDF viewer displaying a word document with a Version number included, If I edit the document and come back into the App the thumbnail doesn’t show the new version number. Is this a cache error?
Hi Matthew,
Though my excel is of a single sheet. it comes in 2 pages. How can i fix it ??
Nice one. Have you tried it with a SharePoint List an attachments as well?
For example, if you have a Power Apps based SharePoint Form and want to display the attachments within the form.
Christoph,
Use this method by Reza Dorrani to do it:
https://www.youtube.com/watch?v=3dNeMVLZDHo
How can we show office file from dataverse in powerapp screen
Nadeem,
I haven’t looked into it yet…
Hi Thanks for sharing.
Will this work with sharepoint list attachments?
Joni,
No, this article is for SharePoint document libraries only.
Can we convert the mentioned files to PDF but coming from Dataverse instead? I need to convert and show Annotations files in canvas app.
Nidhi,
Please check the 1st comment on this blog where I have already answered this question.
Does the user need to have any particular permission to the SP Document Library? I have a library with Restricted Read permissions. No documents are displaying in the viewer panel – I just get the grey “Couldn’t open PDF file”. It seems the user must have at least Read or Contribute permissions. Any suggestions?
Mike,
If the user can view the documents inside of the SharePoint document library they should be able to view it in Power Apps. Can you please verify that?
As the error message says, the user needs either read or contribute permissions. Check the security permissions on the document library.
Hi Matheu, thanks for wyour example, this is fantastic. I tryed to put it on action, but i couldn´t with xlsx files, can you please help me to understand what am i doing wrong or if there is anything i need to do to achive that. (i can see the ppt files in the PDF viewer)
Hello! when I use this method, I don’t get just the excel file on return. instead, I get a return of a document of twenty pages (what I’m trying to display is one to two pages each document), that consists of all other documents combined in one. to note as well, I tried another method to display only one document with power automate and it is also giving me the same problem.
Austin,
It’s the best method we have available at this present moment. I wish I could help more here…
Nice article. Is it possible to have multiple document libraries as possible data sources, and have the user specify the library? I am looking to do an approval for minutes from different entities each having it’s own SPO site (&library) and would like to have the Approvers (multiple-kudos WonderLaura) look at the document inside the app. If not I guess I can require the initial minutes document to be in a shared site and then use a flow to put the Final document wher it should reside.
Brandt,
Yes, I think you can do it. The user could choose the library from a dropdown:
* Library 1
* Library 2
* Library 3
Then you could run the logic of which document library to target off of a SWITCH function:, “Library 2”, , “Library 3”, )
Switch(Dropdown1.Selected.Value, “Library 1”,
Hi Matthew,
thank you very much for this trick!
Is there a way of opening/viewing these kind of documents if only the shared link is available but the document itself isn’t in a connected library?
I have a gallery which connects to a sharepoint list with several data and rows/columns. One of these columns is the link to a video which I can perfectly show via the Video control.
Basically I look for a way to achieve the same with Powerpoint: saving the link to the sharepoint row and the control opens it up in PowerApps.
Is this possible?
Thank you for the article!
Is it possible to format the PDF in landscape?
This would be brilliant!
Forgive me if this has been stated prior, but in a Word document being viewed in the PDF viewer we have pixelated images (screen shots w/in the document). Does anyone know a way to fix that? If you open in browser or the original Word document, it’s not pixelated.
Substitute(
Gallery4_10.Selected.Thumbnail.Large,
“/thumbnail”,
“/pdf”
)
code not working
Substitute(Gallery3.Selected.‘{Thumbnail}’.Large,“/thumbnail”,“/pdf”)
Hi Matthew,
I have used the above and it works. However in my gallery I will have word docs and pdf’s. So similar issue to Sylwester in the comments. How would i get it to show pdf’s also?