cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Word Online (Business) and Image content controller

Hi

I am trying to add an image stored on OD into a Microsoft Word Template (Image Content Control) during a Flow, but I always get an error in Flow: "Action 'Populate_a_Microsoft_Word_template' failed". It says that it's not a valid PNG/JPG file.

According to the documentation here, the value of the param for Image Content Control should be:

{ "$content-type": "image/png", "$content": "iVBORw0KG...i/DhQmCC" } where the content is the base64 encoded image.

So what I am doing is to read my PNG file into a variable and encode it with base64():

1.JPG

I then use the variable in my Populate a Microsoft Word template action:

1.JPG

 

I tried both with single and double quotes
{ "$content-type": "image/png", "$content": "........." }
{ '$content-type': 'image/png', '$content': '.........' }
but I always get the same error.

I also tried to find some examples on the web, but found only examples for Plain Text Context Controls, not for Image Content Controls...

Any ideas? Thx!

 

 

 

 

 

3 REPLIES 3
Highlighted
Helper I
Helper I

Re: Word Online (Business) and Image content controller

Ironically I just used this answer for another post as well.  Today in the Flow of the Week the post showed an example of using an image control in Word and inserting an image from Flow.  You can find the post here

 

Be sure the image control in Word has a name, then in Flow you just use the Get file content action and on the create Word action, that control should appear in the action to populate from your Get file content action.  Hope it helps!

Highlighted
Regular Visitor

Re: Word Online (Business) and Image content controller

Not working for me. I get message as "This picture can't be displayed" in the word document.

 

 
 

 

Highlighted
Post Prodigy
Post Prodigy

Re: Word Online (Business) and Image content controller

Hi ,

 

First of all create a variable of type object and set the value as :

 

{
  "$content-type""image/png",
  "$content""base 64 string"
}
 
As described in msdn site the word document template needs to be created.  Then after populating word template it needs to be saved . In my case I tried saving in Sharepoint using Create File action.
 
Thanks

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,810)