In Focus Resource Center > Insights

Modern Document Management with Power Platform and Dynamics 365

Part 2: Creating and Adding Documents to SharePoint

By Andrew Yoder .

February 28, 2025

Automating PDF Creation and Metadata Tagging

A common client request is generating PDFs from Power Platform data. While many tutorials explain how to create PDFs using Power Automate, this post focuses on saving and tagging these documents in the SharePoint Library set up in Part 1.

Assuming you already have a Power Automate flow that generates a PDF from a Microsoft Word template, the next step is to save the document in SharePoint. Most guides stop at saving the file, but this approach misses the opportunity to enhance usability by adding metadata for efficient searching and filtering. Metadata—descriptive tags about data—makes records easier to locate.

To add metadata to SharePoint documents:

  1. Use the "Get file content" action to retrieve the document’s data for the dataURI column using this expression:
    datauri(base64ToBinary(body('Get_file_content')?['$content']))
    Get file content
  2. Use the "Update file properties" action to populate additional SharePoint columns. For example, use dynamic content to add a Contact GUID and other relevant metadata.

    CRM Library

With this approach, the newly generated document becomes easily searchable by users or automated processes.

Copying Files from CRM to SharePoint

In addition to generating PDFs, businesses often need to save external documents, such as medical clearance PDFs, to a CRM record. This process ensures that these documents are accessible to users and properly tagged for easy retrieval.

Flow Example: Uploading a Medical Clearance Document

  1. Trigger Condition: Check that the document field in the CRM has been updated and is not null.

    Trigger condition
  2. Download File: Use the Dataverse action "Download file" to retrieve the file and save it to the SharePoint Library.

    Download file
  3. Add Metadata: Retrieve related CRM record data and use the "Update file properties" action to tag the file with metadata, such as patient name, facility, and associated records.

    Trigger condition

By combining automated document handling with metadata tagging, organizations can create a streamlined, searchable, and organized document management system in SharePoint. Part 3 of this series will provide a walkthrough of the process of creating a Command Ribbon Button in a Model-Driven App. For questions, reach out to your Citrin Cooperman advisor or Andrew Yoder at sales@citrincooperman.com.

Other articles in this series include:

Part 1: Structuring a SharePoint Library

Part 3: Retrieving Documents

Related Insights

All Insights

Our specialists are here to help.

Get in touch with a specialist in your industry today. 

* Required

* I understand and agree to Citrin Cooperman’s Privacy Notice, which governs how Citrin Cooperman collects, uses, and shares my personal information. This includes my right to unsubscribe from marketing emails and further manage my Privacy Choices at any time. If you are a California Resident, please refer to our California Notice at Collection. If you have questions regarding our use of your personal data/information, please send an e-mail to privacy@citrincooperman.com.