Embed image in word document dynamically using Power Automate from Dataverse
If you want to embed images dynamically from Dataverse Image column in WORD document template using power automate, then this post will help you.
Read my previous article to know how to generate QR Code and bar code using power automate and upload in image column in Dataverse.
The scenario:
We have 2 image columns in Dataverse contact table to store Barcode and QR Code. Now We want to embed the QR code and Bar code in blow word template and attach in a file column in Dataverse for the same record.
Solution
Step 1 – Prepare Document Template and Upload in OneDrive
Create a Microsoft word document and add content of your choice and also change the style as per your desired styling with colors.
Add controls to represent as placeholder for Customer Name (1), QR Code (2) and Bar Code (3) inside the documents as mentioned in the document below. Use Developer TAB to add controls and use properties to add name values to controls that will be referenced in Power Automate.
Use properties to set the control properties.
Do the same for Images control.
Once done save the document and upload in OneDrive Business.
Step 2 – Prepare Power Automate to download the Images
Trigger condition to initiate the Flow when the Token Sent flag updates.
Create the Bar code using Encodian Connector.
Create QR Code using Encodian Connector.
Upload barcode against Dataverse Image column for the contact.
Upload QR Code against Dataverse Image column for the contact.
Download Barcode from Dataverse Image column.
Download QR Code from Dataverse Image column.
Prepare Compose to format File Type for Barcode
{
"$content-type": "image/png",
"$content": "@{base64(outputs('Download_a_file_or_an_image')?['body'])}"
}
NOTE : use base64 expression to convert image column to base64
Prepare Compose to format File Type for QR Code
{
"$content-type": "image/png",
"$content": "@{base64(outputs('Download_a_file_or_an_image_2')?['body'])}"
}
NOTE : use base64 expression to convert image column to base64
Populate word template action.
Upload Word document to contact record.
Watch the complete video here.
Hope this helps.
Follow my blog for more trending topics on Dynamics 365, Azure, C#, Power Portals and Power Platform. For training, Courses and consulting, call to us at +91 832 886 5778 I am working more for community to share skills in Dynamics 365 and Power Platform. Please support me by subscribing my YouTube Channel. My YouTube Channel link is this : https://www.youtube.com/user/sppmaestro