• Documentation
  • Back to www.mscrm-addons.com
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/DocumentsCorePack(DCP)/Build a Multipart XML Flow that concatenates all documents into one File

Build a Multipart XML Flow that concatenates all documents into one File

360 views 0 Updated on February 24, 2022

In this blog you can learn how to create a Mulitpart XML document with Power Automate. This example is using the account Entity and creates a document for all “Accounts“.

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


Figure 1: Flow started by trigger

Then we are creating and initialize a variable to build a custom XML for DocumentsCorePack.

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

If you use the SharePoint Integration to save your files, don´t forget to turn the option “Save to SharePoint” to “true“.

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


Figure 2: Dataverse – List rows function

Then the loop is used to build the XML for all Accounts. The XML has to look that way:

</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 are the header and footer from the xml we need to create, the black line is the dynamic part (required for each document to create).

The template ID and Entity is static in this example.

The Entryid Account has to build as a function: Items (‘apply to each’)[accountid].

Please note: The red section is not part of the XML, just 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. Therefore 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 function (to convert it from base64 before).

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
  • How to access mscrm-addons product settings in Dynamics 365
  • One-Click-Actions (OCAs) in DocumentsCorePack
  • Service Configuration options
  • Multipart documents in DocumentsCorePack
  • Azure Active Directory Licensing counts explained
  • DocumentsCorePack: Performance benchmark, limitations & scalability
Leave A Comment Cancel reply

Latest Articles
  • How to display various activity-attributes within multiple rows in Gantt view
  • Recap: European Power Platform Conference 2022
  • How to solve the issue with DocumentsCorePack fields in Arabic text
  • How to access mscrm-addons product settings in Dynamics 365
  • One-Click-Actions (OCAs) in DocumentsCorePack
Popular Articles
  • DocumentsCorePack Online Service Configuration
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
  • mscrm-addons.com Application Access for Dynamics 365 (App Access) – DocumentsCorePack
  • How to activate the DocumentsCorePack connector for PowerApps & Microsoft Flow
  • How licenses are counted
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
  • Can you save data capacity by moving email content?
  • How to shorten an alias (Alias is longer than 128 characters)
Categories
  • *News and General Infos* 50
  • Template Designer(DCP 160
  • DocumentsCorePack(DCP 180
  • TelephoneIntegration (TI 64
  • AttachmentExtractor (AE 55
  • PowerSearch (PS 43
  • ActivityTools (AT 57
  • SmartBar (SB 51
  • GroupCalendar (GC 45
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.