I am trying to create a flow that takes all images from share point folder and populate in word template. Currently folder in sharepoint and word template both have 4 images with .png extenstion and 4 image placeholders respectively.
i have tested the base64 prefectly encode to the required image . i am not sure why populate ms word template not working, is it license issue.
i read online that instead of array, one sud declare it object and then populate, but i m not sure how to do it also things work good with single image, but how abt array of images.
can it be license issue
hi @AlexEncodian I tried the approach, but its not working for me,
below is my QR code array
{
"QRCodes": [
{
"Name": "Test",
"Base64image":"@{first(variables('QRCodes'))}",
"Floor_Number":"@{first(variables('Floor_Number_Array'))}",
"Structural_Condition":"@{first(variables('Structural_Condition_Array'))}",
"Element_ID":"@{first(variables('Element_ID_Array'))}",
"Remarks":"@{first(variables('Array_Remarks'))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),1))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),1))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),1))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),1))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),1))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),2))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),2))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),2))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),2))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),2))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),3))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),3))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),3))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),3))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),3))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),4))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),4))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),4))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),4))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),4))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),5))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),5))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),5))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),5))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),5))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),6))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),6))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),6))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),6))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),6))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),7))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),7))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),7))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),7))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),7))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),8))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),8))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),8))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),8))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),8))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),9))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),9))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),9))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),9))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),9))}"
},
{
"Name": "Test",
"Base64image":"@{first(skip(variables('QRCodes'),10))}",
"Floor_Number":"@{first(skip(variables('Floor_Number_Array'),10))}",
"Structural_Condition":"@{first(skip(variables('Structural_Condition_Array'),10))}",
"Element_ID":"@{first(skip(variables('Element_ID_Array'),10))}",
"Remarks":"@{first(skip(variables('Array_Remarks'),10))}"
}]
}, error is
Please have a look at the Template Syntax documentation. The Template Library also has many examples of how to configure templates. For basic text merge fields, have a read of Template Syntax Overview
how can i modify encodian template to include the other info like Element_ID, Floor_Number etccurren
current Encodian template looks like
aldo my http request is also not able to fetch the info like ElementID, Floor_Number
@swami12345 Yes - its easy to do in the Encodian template as per the links I provided below.
Thank you for your feedback.
I want to know whether i can modify the Encodian template as per my requirement. If yes, then can i develop JSON for the template to use in Power-automate flow.
You need to implement a different Template Syntax, specifically around Repeating Content and Images. Have a look at the QR Sheet example in the Template Library.
In your flow, you would just use Encodian's Populate Word Document action rather than using the Word connector action. Just search for Encodian when adding an action and you'll find it.
Have a look at this video:
Advanced Scenarios Populate a Word Document with Power Automate (youtube.com)
Note, Encodian is a 3rd party connector. You need to create an account at the link below. No credit card information required and its free for 50 credits per month.
Encodian Flowr — the Ultimate Standard Power Automate Connector
how can i modify my flow so that i can populate the images from an array in the word template using Encodian's populate word template
I believe the native Word connector works by mapping an image to an image content control in the template. So as you suggest, you have to declare each individually rather than passing through an array of images. It also means you have to know how many images you will populate in advance. Since you know you will have 4 images, it should work for you?
If you need more flexibility or want to pass through an array of images, you can do this using Encodian's Populate Word Document action. Its a standard connector but 3rd party (generate 50 word documents per month free). It handles x number of images and image arrays.