Download SharePoint library files in Power Pages with JavaScript and Cloud flows – Improved code using jQuery & option to open PDF file in a new tab


Last week I demoed an improved solution of my previous blog post: Using JavaScript and Cloud Flows to download files from a SharePoint document library in Power Pages in the Microsoft 365 & Power Platform community (PnP) call.

The Cloud flows are the same as on the previous post, but on the JavaScript side there were a few updates:

  • Using jQuery instead of Vanilla Js
  • Added more comments to the code
  • Added option to preview PDF files on a new tab (be aware that you need to allow pop-ups in your browser for the site address for it to work)

Source code

The updated source code for the Power Pages page follows below:

<div class="row" style="min-height: auto; padding: 8px;">
  <div class="container" style="display: flex; flex-wrap: wrap;">
    <div id="divFolderBreadcrumbContainer" class="spbreadcrumb" style="margin-bottom: 16px; width: 100%;"></div>
    <div class="spfoldercontent" style="min-width: 360px; width: 100%;">
      <div id="table_container"></div>
      <div...

Source link

More About This Author

michelcarlo
michelcarlo
SharePoint and Office 365 Consultant/Developer always trying to get the best from Microsoft stack (Microsoft 365/Azure/Power Platform and related stuff).

Living in Ireland since 2018, I had previously worked in Brazil as a consultant/developer for Office 365, SharePoint and related technologies for almost 10 years.

Author: michelcarlo

SharePoint and Office 365 Consultant/Developer always trying to get the best from Microsoft stack (Microsoft 365/Azure/Power Platform and related stuff). Living in Ireland since 2018, I had previously worked in Brazil as a consultant/developer for Office 365, SharePoint and related technologies for almost 10 years.

Share This Post On
Share via
Copy link
Powered by Social Snap