Error with Pictures in DOCX Templates

Hi Plumsail Team,

I'm trying to insert an image into a Word template using the {{#picture tokenName}} syntax - both in the template and as the image Alt Text - but the image is not rendering in the final document. Instead, the placeholder remains.

Here's what I've tried:

  • I am using Power Automate to retrieve an image file from SharePoint using the Get file content action.

  • I then convert the body output to base64 using the expression:
    base64(body('Get_Image_Content'))

  • This value is passed into Plumsail via the tokenName token in the JSON payload:

    {
      "tokenName": "<base64 string here>"
    }
    
  • I’ve confirmed that the base64 string is valid — I can decode and preview it using external tools like Code Beautify.

  • I’ve also tried other template syntaxes like {{picture tokenName}} and {{tokenName}}, but no image renders.

Is there any specific requirement for the base64 format (e.g. prefix, MIME type)? Or is there another recommended approach to insert a dynamic image into a Word template using Power Automate and Plumsail?

Any insight would be greatly appreciated!

Thanks,

Hi!

Based on your JSON payload, you can use the following operation to work with a Base64 image in your template:

{{tokenName}:picture}

You'll find further details in our documentation on how to work with pictures.
Hope this information is useful!

Best regards,
Milagros
Plumsail team