The blog discusses how to retrieve SharePoint documents recursively using the GraphAPI Connector and PowerFx. The author had a requirement to display SharePoint related documents for a Dynamics 365 implementation on either a Canvas App or Custom Page. The solution should allow the page to provide an overview of multiple SharePoint sites. The author initially experimented with using the SharePoint (Document Library) connector and a cloud flow, but faced limitations in terms of speed and connecting to various SharePoint sites.
The chosen solution allows for the dynamic connection to multiple SharePoint sites and is adaptable for future changes in SharePoint sites. This solution, founded on the GraphAPI, provides custom capabilities like inputting the name of a site, and retrieving corresponding site IDs. The solution also manages to efficiently loop through all the subfolders and effectively retrieve documents. Using the Canvas App for display, the folders are successfully being filtered out to show only document files. This dynamic solution also offers a robust document preview functionality by utilising an IFrame PCF. The preview URL can be retrieved from GraphAPI, making the solution practical for large scale companies and versatile for a variety of uses.
Microsoft experts can learn how to use GraphAPI to recursively retrieve SharePoint documents in Canvas Apps. This solution is based on GraphAPI and requires Office365Groups. First, the user must input the name of the site they wish to access. To test the requests, the Graph Explorer can be used. Reza Dorrani's videos provide an excellent starting point for understanding the process, including using the SharePoint Document Library connector and Cloud Flow in Power Automate, and connecting directly to SharePoint sites. The GraphAPI docs provide more in-depth information about what can be done. Once the connection is made, a Canvas App is used to show the documents related to the Dynamics 365 implementation. This solution is able to show an overview of multiple SharePoint sites, and is faster than the initial approaches.
SharePoint Documents Integration, GraphAPI, PowerFx, Dynamics 365, Canvas Apps, Power Automate, Office365Groups, Graph Explorer