Hi community,
I have to build a workflow with Power Automate cloud which is able to generate a Word document containing several images. The number of images may vary between two executions of the flow.
Here is the use case :
The document I have to generate must contain QR codes, in a table. One code per row on the 2nd column, the 1st column will contain a label corresponding to the value of the code.
By following some tutorials and videos, I manage to create a Word template containing a one-row & two-columns table.
1st cell contains a text content control, 2nd cell contains an image content control.
I've set on the template a repetitive content control, in order the table to dynamically add rows as needed when the Power Automate flow is triggered.
That works fine with text content control, as the different values are processed in a loop on the flow, and added to the text content control through the Populate a Microsoft Word template in the flow.
Doing the same with image content control is more tricky than I thought.
In the flow loop, I've added HTTP action which makes a GET request to a public API that generates QR code.
The output is like below :
{
"$content-type": "image/png",
"$content": "iVBORw0KGgoAAAANSUhEUgAAAEEAAABBAQMAAAC0OVsGAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA2klEQVQokX3SsQqDMBAG4CuB3lLomi2voFun5lUCeYE+QCGCq9BX0sVs9RWEDq5KFwXxmtJWYhv7T99wHD/cAcwxVOQnTeRLga3oBhiW7ouJpcIuZa/mj/I400spKKP9e/OvDJVu7tXqI5dNWr9r/8j01NHYHBZCzOEMKwIcqkuNcik57RNYEcPhym7c+lIEcaueDYISfWTSRvrSKLtWP0sHxYciM2R9AWyB1RzDciNVorn0pSA/7hTHsNxlJkY9fakbhZBrKiOTNNaX+4jiPtYYluvSZUJQWHMeFSbsieiTYCYAAAAASUVORK5CYII="
}
The image content control is working fine if I set manually on my template several image controls like :
qrcode1
qrcode2
qrcode3
qrcode4 etc ....
By doing this, I see in my "Fill out a Microsoft Word template" the corresponding fields but this is not viable because it implies that I have to create as many content controls as necessary in the template. However, I want the image content controls to be added automatically depending on the number of images created.
This is where I'm at, I'll take any suggestions :)
Thanks
Remi