• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/DocumentsCorePack(DCP)/How to work with the new DocumentsCorePack custom connector for PowerAutomate (Microsoft Flow)

How to work with the new DocumentsCorePack custom connector for PowerAutomate (Microsoft Flow)

1593 views 3 Updated on July 26, 2022

This step-by-step tutorial outlines how to create a document and attach it to an e-mail using the DocumentsCorePack custom connector for PowerAutomate (Microsoft Flow).

Overview of the Flow

This flow is triggered on the update of a record (Account in our case), it then creates an E-mail using the “Create new Record” step from the common data services connector. Afterwards we are using our DocumentsCorePack custom connector to create an e-mail body from a DCP Template and attach it to the e-mail. Then we create an e-mail attachment and attach it to the same e-mail. The last step finally sends the e-mail.


Figure 1: Overview of the Flow

1. Trigger

When you create a new flow, you have to decide which action will trigger the flow. In our case we have simply added a trigger on the update of the Account.


Figure 2: Trigger

2. Create E-mail

In the second step we create an E-mail Message, you can leave the sender, recipient and regarding empty for now, as our DocumentsCorePack custom connector offers a very easy way to fill them later. You can still already fill the Subject and Description to your liking.


Figure 3: Create E-mail

3. Create E-mail Body

To create the E-mail Body, we are using the DocumentsCorePack custom connector and choose the step “Create Document Job (sync)”. In this step it is mandatory to specify a template which shall be used to create the e-mail body, and an Entity ID with which the Template shall be merged.

Please note: The template needs to be created for the Entity Type specified in the E-mail ID.

To create the E-mail Body we must choose the Filetype “HTML”.


Figure 4: Create E-mail Body

4. Attach E-mail Body

After creating the E-mail Body, we need to attach it to the E-mail. For this we select the Document that was created in the previous Create E-mail Body step, this can be found under “Document (Base 64 Encoded)”. We also take the Filename from the previous step and the E-mail Message from the Create E-mail step.


Figure 5: Attach E-mail Body

Here you can see what the “Document (Base 64 Encoded)” looks like:


Figure 6: Document (Base 64 Encoded)

5. Create Attachment

In this step we want to create an additional attachment that shall be attached to the final e-mail.

Again, we have to choose a Template, an Entity ID and an output FileType. As we want an attachment this time we are choosing “PDF”:


Figure 7: Create Attachment

6. Attach Email Attachment

Again, we have to attach the created document to the email. This time we select the “Document (Base 64 Encoded)” and the Filename from the Create Attachment Step.  Additionally, we also need to fill E-mail ID with the “E-mail Message” from the “Create E-mail “Step.


Figure 8: Attach E-mail Attachment

7. Send E-mail

Now that the E-mail Body and E-mail Attachment are attached to our E-mail, we want to finally send the e-mail. For the “E-mail To Send” we choose the “E-mail Message” from the Create E-mail step.

Based on the trigger you have chosen you can either use the “Owner” or “Modified By” user to get the current user, if you have a trigger that allows it you can also get the current user using the “User ID” from the dynamic values. This user can be specified as the sender of the e-mail. For Sender (Schema name) we choose the Entity Type “User”.

Now we also have an option to specify the “Regarding” of the E-mail, for this we used the Regarding (Id) “Account” and the Regarding (Schema Name) Entity Type “Account”.
For the To-Recipient we have chosen the To-ID “Primary Contact” and the To-Schema name Entity Type “Contact”.

To sum up: It is important that the “Schema name” points to the Entity Type of the ID that is specified.


Figure 9: Send Email

That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com

Was this helpful?

3 Yes  No
Related Articles
  • Document Generation via Copilot in Dynamics 365 Sales using DocumentsCorePack
  • DocumentsCorePack: Best practices for Dynamics 365 on-premises to online migration projects
  • Multilingual Support in DocumentsCorePack
  • Configure DocumentsCorePack within custom pages
  • Ensuring correct time zone display for DateTime fields
  • Document Generation Failure from Missing Privileges
Latest Articles
  • Document Generation via Copilot in Dynamics 365 Sales using DocumentsCorePack
  • DocumentsCorePack: Best practices for Dynamics 365 on-premises to online migration projects
  • Multilingual Support in DocumentsCorePack
  • Recap: ColorCloud 2025
  • Configure DocumentsCorePack within custom pages
Popular Articles
  • DocumentsCorePack Template Designer – Getting Started
  • Step-by-Step: How to configure a One-Click-Action
  • Application Access for Dynamics 365
  • How to find your environment’s unique name in Microsoft Dynamics 365
  • How licenses are counted
Top Rated Articles
  • “Undefined”-labels in Chrome and Edge 114 and higher
  • Important information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack Connector for PowerApps & Microsoft Flow
  • How licenses are counted
  • How to insert Condition Fields in DocumentsCorePack Templates designer
Categories
  • *News and General Infos* 62
  • Webinars 45
  • Template Designer(DCP 196
  • DocumentsCorePack(DCP 251
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 72
  • PowerSearch (PS 50
  • ActivityTools (AT 61
  • SmartBar (SB 54
  • GroupCalendar (GC 47
Our Vision

“We see it as our purpose to provide products that simplify and speed up our customers’ Microsoft Dynamics 365 experience.”

Knowledgebase
LogIn
mscrm-addons.com
  • Products
  • Online Shop
  • Downloads
  • My Account
About Us
  • About Us
  • Case Studies
  • Newsletter
  • Partner Program
  • Contact
Support
  • Support
  • Terms & Conditions
  • Documentation
  • Webinars
  • Legal Documents
  • Impressum
  • © 2022 www.mscrm-addons.com. All Rights Reserved.