Starting to see a few requirements coming up from clients around surfacing documents in sub grids or being able to access documents through Embedded Canvas Apps for SharePoint from Dynamics 365 CE records.
Thought I would try implementing this through the use of Flow and specifically the OOTB SharePoint connectors. The connector I'm going to be using is the "Send HTTP Request to SharePoint" which allows to construct a custom request.
Essentially the process will involve the normal OOTB SharePoint integration with Dynamics 365 and will have the following steps:
- Get GUID of current record through the form integration data
- Query for the relative URL stored on the document location record related to the primary record (using Dynamics 365 connector, as at time CDS didn't have document locations)
- Construct an HTTP request to SharePoint to retrieve the list of documents
- Return the Array of documents to the PowerApp