This is a great video which helped me on a way: https://www.youtube.com/watch?v=-1jsBllmr-w

However, in this video, it takes an image from OneDrive but I want to populate it from CDS image field.

  1. Add image control to a Word template. Watch the video I referred above showing how to add controls step by step then come back for the image adding part.
This image has an empty alt attribute; its file name is image-5.png
Image control inside Word template.

2. This is my image store in CDS:

This image has an empty alt attribute; its file name is image-6.png
CDS image displayed on a Job form.

3. And a CDS field set up.

This image has an empty alt attribute; its file name is image-8.png
CDS image field setup.

4. And now Flow:

This image has an empty alt attribute; its file name is image-9.png
Get record CDS connector action to retrieve the record with image.
This image has an empty alt attribute; its file name is image-11.png
Populate Word template action with the image control placeholder and compose output content.

Here JobDescription and JobImage are fields of a Job entity.

5. A few actions outputs to see how the image is stored:

This image has an empty alt attribute; its file name is image-13.png
Get record CDS connector action
This image has an empty alt attribute; its file name is image-12.png
Image string in the output for Get record

The format is: application/octet-stream.

According to docs(https://docs.microsoft.com/en-nz/connectors/wordonlinebusiness/#populate-a-microsoft-word-template):

Guide for using Images in the Word Online connector.

  1. Add an Image content controller in your template. Don’t delete the placeholder image. You can re-size and re-position it.
  2. Add a title property to the image content controller so that you can easily identify it in the Power Automate designer.
  3. When the image field shows up in the designer, add file contents of a JPG or PNG image as the value. The value should look like this: { “$content-type”: “image/png”, “$content”: “iVBORw0KG…i/DhQmCC” } where the content is the base64 encoded image.

6. That’s why we use Compose to construct the required JSON:

This image has an empty alt attribute; its file name is image-14.png
JSON composed with the dynamic image field

7. And the result in the generated document as expected:

This image has an empty alt attribute; its file name is image-15.png
Image generated from CDS in the document template populated

Hope it helps!