• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/DocumentsCorePack(DCP)/Build a Multipart XML flow that concatenates documents into one file

Build a Multipart XML flow that concatenates documents into one file

878 views 0 Updated on November 6, 2022

In this article, learn how to create a document package in Power Automate consisting of multiple elements. The definition of the documents to be included in the package is XML based. In this example, we will create a package consisting of a document for every account in our system.

First, we have to create a Flow in Power Automate. This can be an Automatic or Manual Flow, started by a trigger.

Next, we need to create and initialize a variable to build a custom XML for DocumentsCorePack.

Set the converttopdf value to True to create a single pdf file. False will create a docx instead.

If you use the SharePoint Integration to save your files, don´t forget to set the option Save to SharePoint to True.


Figure 1: Flow started by trigger

Next, we use the Dataverse – List rows function to get the account ID for all Accounts.


Figure 2: Dataverse – List rows function

The loop is then used to build the XML for all Accounts. The XML must look like the following:

</doc>
<docparts converttopdf="False" savetosharepoint="False">
<docpart template="ab36bcda-63a4-4513-a7c5-759a63fad1b2"
= Template GUID
entity="account" entityid="5e88db20-d2fc-480b-b656-a76a714af862" />
Entity ID here is the GUID from the Account, the template shall be created for. 
This section needs to be repeated for all Documents to create
</docparts>
</doc>

Figure 3: XML for all Accounts

The blue lines that will show are the header and footer for the XML we need to create, and the black line is the dynamic part (required for each document to create).

The template ID and Entity are static in this example.

The Entry ID Account has to be built as a function: Items (‘apply to each’)[accountid].

Please note: The red section that will show is not part of the XML, but is part of the comments.


Figure 4: Entryid Account has to build as a function

In the last step, we append the end of the XML tab and execute the Automergeworking item that creates the document.

If you want to save the created document to a custom path, then do not use the CRM SharePoint integration. Instead, you have to add another step to your Flow.


Figure 5: Save created doc to a custom path

The file content must be build as a function (to convert it from base64).

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

Was this helpful?

Yes  No
Related Articles
  • AssureSign for DocumentsCorePack
  • How to conditionally remove a watermark in DocumentsCorePack templates
  • Document Processing with DocumentsCorePack (DCP)
  • How to activate SharePoint in DocumentsCorePack
  • Fillable PDF forms
  • Document concatenation in DocumentsCorePack 
Leave A Comment Cancel reply

You must be logged in to post a comment.

Latest Articles
  • Working with Product Properties in DocumentsCorePack
  • How to work with the Relationship Manager
  • Using virtual tables in DocumentsCorePack
  • DocumentsCorePack Template Designer Settings
  • How to solve: Failed to connect to an IPC Port
Popular Articles
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
  • DocumentsCorePack Template Designer – Getting Started
  • mscrm-addons.com Application Access for Dynamics 365 (App Access) – DocumentsCorePack
  • DocumentsCorePack Online Service Configuration
  • Step-by-Step: How to configure a One-Click-Action
Top Rated Articles
  • IMPORTANT information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack connector for PowerApps & Microsoft Flow
  • Step-by-Step: How to configure a One-Click-Action
  • Online Services: Required Application Permissions
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
Categories
  • *News and General Infos* 51
  • Webinars 35
  • Template Designer(DCP 180
  • DocumentsCorePack(DCP 191
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 62
  • PowerSearch (PS 48
  • ActivityTools (AT 59
  • SmartBar (SB 53
  • GroupCalendar (GC 46
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.