cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StuCundy
Post Patron
Post Patron

Get JPG value for word document template

Hi

I have a flow for populating a word document.  I have this done and now I want to have a couple of selected images be populated in the document as well.

My flow errors after retrieving the correct items at apply to each.  

{
  "status": 400,
  "message": "The image is not of type PNG or JPG. Please provide an image of type PNG or JPG.\r\nclientRequestId: c203e171-4b8a-4675-9672-dea939a4d1fe",
  "error": {
    "message": "The image is not of type PNG or JPG. Please provide an image of type PNG or JPG."
  },
  "source": "wordonlinebusiness-ase.azconn-ase.p.azurewebsites.net"
}


I see the Word online business guide says "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." 

 

The column I was trying to connect was the mulitline one featuring the base64 (data:image/png;base64,iVBO......)

 

How do get this required value?

10 REPLIES 10
ManishJain
Solution Sage
Solution Sage

Hi @StuCundy ,

 

Are you looking for something similar to this thread :

 

https://powerusers.microsoft.com/t5/Building-Flows/Populate-Word-Template-with-Multiple-Images-submi...

 

Thanks

Hi @ManishJain 
I guess so.  Can you guide me through the steps?

Hi @StuCundy ,

 

Please share your flow screenshots. 

 

Thanks

Hi @ManishJain 

 

flowall.pngflowallword.png

 

I have just the one picture columm but I think it I want to have 2-3 images I need to have that amount of columns?

Hi @StuCundy ,

 

You do not have to use Apply to each loop to add image to word. Instead use First(outputs(Get_items)?['body/value/imagecontent']).

 

Thanks

Hi @ManishJain 

Is this "First(outputs(Get_items)?['body/value/imagecontent'])"  a Filter query in Get items?

I'm lost sorry.

Hi @StuCundy ,

 

The output of get items is an array , whereas you are having only one image. So have a look at the output of Get items and share that.

 

Thanks

Hi @ManishJain 

I am getting back to this little challenge I have as it is till not solved.

I have the report text populating the template fine but its when I want to insert the image.   I would like to go back to my working flow for just text and get you to guide me through adding the image if you could.

I have the images in two places trying to work out which is best. 

1. A image SP list with reference to the report SP list ID.

2. A document library with a reference column to the report SP list ID

 

In the flow that works is below.  whats my next step?

Screen Shot 2020-07-05 at 1.47.24 PM.png

Hi @StuCundy ,

 

I see you are able to create word file and save it in sharepoint. Could you post what is the end result you want to accomplish after this ?

 

Thanks

Hi @ManishJain 

I want to show a picture in the produced word document.

I have been able to get the URL and Base64 text for pictures but cant get them to the word document.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (59,045)