2. PA_Graph_Site_List_Libraries Flow
At a high level at least, as noted above, this Flow is by far the most complex of the Flows described in this blog. The Flow contains numerous steps that manipulate that data returned from 4 “primary” steps that surface relevant information in SharePoint including Subsites, Document Libraries and Lists for any given site (or subsite for that matter) leveraging the SharePoint Graph v2 APIs.
This Flow could just as well be split into 3 more simplistic Flows. However as this blog speaks to the functionality depicted in the demo app I created for this blog, I elected to leave this Flow as-is. The reasoning behind this is because in the demo app the information related to PowerApps based upon a one schemas fits all approach regardless as whether any give run returned by the Flow could just is easierly be a Subsites, Document Libraries or List for any given site being queried.
What the data manipulation steps in this Flow are by and large to in essence transform the data returned from the Graph API steps in the Flow, in order that the same schema definition for any row returned by the Flow is identical whether that be Subsites, Document Libraries or Lists within any given site.
By example, by implementing this pattern showcased in demo app for this blog, I used a single Gallery control associated to the same collection as was return by that Flow. On the Items property on the singular control the think then further need to is Filter that collection based upon variable set when user clicks on the button to select and view either Document Libraries, Lists or Subsites within the parent site, greatly simplifying the amount of effort you like need to otherwise implement.
There are few noteworthy steps in this Flow that are pertinent to call out as they encompass the just of the information that this Flow returns.
PowerApps Trigger
A PowerApps trigger is used to instantiate this Flow along with a single input parameter being the relative URL of the site being queried. For example:
- teams/demo
- teams/sales
- teams/sales/forecasting
- sites/intranet
Get Site Information
This step in the Flow is a Send an HTTP request to SharePoint action that calls the SharePoint Graph v2 Sites API to quote:
“Retrieve properties and relationships for a site resource. A site resource represents a team site in SharePoint.“
In the Uri property of this step in the Flow, the Tenant Name
is derived from a variable initialized earlier in the Flow. The final part of the Uri is the input parameter passed to the Flow (Ask in PowerApps
).
Get Subsites
As with the Get Site Information step in this Flow, this step in the Flow so too includes a Send an HTTP request to SharePoint action that calls the same said SharePoint Graph v2 Sites API.
The only different between this step in the Flow and the Get Site Information step in the Flow is this step retrieves the subsites for the site being queried.
Get Site Lists And Libraries
This step in the Flow is a Send an HTTP request to SharePoint action that calls the SharePoint Graph v2 Lists API action to retrieve a collection of lists and document libraries for the site being queried.
The Odata $select statement is specified in order that system Document Libraries and Lists are also included in the result set returned by the Flow. By default system Document Libraries and Lists are hidden.
Get Site Document Libraries
This step in the Flow is a Send an HTTP request to SharePoint action that calls the SharePoint Graph v2 Drives API action to retrieve some additional information pertaining to the document libraries for the site being queried, such as the total size of the contents in the document library as well as the number of files in each document library etc.
Select Return Fields
In the Select Return Fields step in the Flow, numerous metadata fields are specified to return useful information to PowerApps pertaining to all of the Document Libraries, Lists and Subsites for the site queried.
Get Drive Items doesn’t seem to be available anymore? I couldn’t figure out an easy way to do this, other than either creating my own connector to graph API or using the HTTP request action.
Hi,
I found this amazing blog post of yours through the Power Apps Community page:
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Word-Office-documents-viewer-control-in-PowerApps/idi-p/19431/page/3#comments
where you said, “I’ve now also shared a link to download the simplified PowerApp on my related blog post.” I’ve been looking for the link to download the PowerApp but can’t find it. Is this the blog where the link is located?
Thanks!
The link to a GitHub repository “was” at the end of the blog however I made it private because I have been considering modifying some of the flows to “possibly” make them easier to follow and equally surface more information.
That said I’ve “temporarily” made the GitHub repository for the original flows publically viewable again, albeit that I will make it private again in a few days. Primarily because I am working on a new blog where there is a lot functionality I’ve been developing such that it will be that much easier to read the new blog, follow the technical site and leverage for use in App Makers own apps. The new blow secifically pertains to changes made to the PA_Graph_DriveItems flow in this blog.
GitHub – Office365Master/PowerApps-SharePoint—The-Ultimate-User-Experience
https://github.com/Office365Master/PowerApps-SharePoint—The-Ultimate-User-Experience