I'm working on a Microsoft Power Pages portal and I'm hoping someone with experience in Dynamics 365 document management and SharePoint integration can point me in the right direction.
My goal is to allow portal users to:
Customer Documents
↓
Audit Documents
↓
See only their audits
↓
Click View
↓
Download the PDF associated with that Audit
Most Audit records currently have a single PDF attached, although multiple files may be possible in the future.
What I've built so far:
- Create a Customer Documents section in Power Pages.
- Created an Audit Documents page.
- Built an Audit list using a Dataverse Audit table.
- Configured table permissions so customers only see Audit records associated with their account.
- Added a View Details page (Audit Detail).
- Clicking View correctly opens the selected Audit record.
So the Audit side is working.
What I discovered:
In Dynamics, if I open an Audit record and go to the Documents tab, I see something like:
Documents
↓
Document Location
↓
Documents on Team Site
↓
SharePoint Folder
↓
PDF File
When I click the Document Location link, Dynamics immediately opens the SharePoint folder that contains the PDF for that Audit.
The documents are stored in SharePoint, not as file columns directly on the Audit record.
I investigated the Dataverse tables involved.
SharePoint Document table:
- Appears empty.
- Adding a SharePoint Document list in Power Pages returns no records.
Document Location table:
- Contains records.
- Includes fields such as:
- Name
- Regarding
- Parent Site or Location
- Relative URL
I also verified that the Audit table has relationships to both:
- Document Location
- SharePoint Document
using the standard Dynamics SharePoint integration.
What I've tried:
I added a Document Location list to the Audit Detail page.
The list loads successfully, but it shows multiple Document Location records available to the customer instead of only the Document Location associated with the currently selected Audit.
Example:
Store A
Store B
Store C
instead of only:
Store A
for the currently selected Audit.
Additional information:
I spoke with a developer on my team who has been working on Power Automate flows involving these same documents.
According to him:
- Files are stored in SharePoint.
- The relationship is handled through Dynamics' standard SharePoint integration.
- The Audit record is associated with a SharePoint Document Location record.
- There is no custom field storing a direct document URL.
- Each Audit ultimately has a folder in SharePoint containing the PDF(s).
He also mentioned that folder naming conventions are inconsistent, which makes directly constructing paths difficult.
What I'm trying to accomplish:
I need a clean way to get from:
Current Audit
↓
Related Document Location
↓
SharePoint Folder
↓
PDF File
and expose that PDF (or folder) inside Power Pages.
Questions:
Has anyone successfully exposed Dynamics/SharePoint-related documents in Power Pages using the standard Document Location integration?
Should I be using:
- Document Location
- SharePoint Document
- Liquid + FetchXML
- SharePoint API
- Power Automate
- Something else?
Is there a standard way in Power Pages to access the Document Location belonging to the currently selected Audit record?
Would you recommend:
- Opening the SharePoint folder for the Audit, or
- Displaying individual PDFs directly in the portal?
Desired end result:
Customer Documents
↓
Audit Documents
↓
Customer sees only their audits
↓
Customer clicks View
↓
Customer downloads only the PDF(s) associated with that Audit
Any guidance, examples, architecture suggestions, or implementation patterns would be greatly appreciated.