web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Insert JPG file (Picture) from HTTP Request in Word document

(0) ShareShare
ReportReport
Posted on by 18

Hi all,

I have an HTTP Request in my cloud flow where I get data (JSON format) from a third-party API. In my response, I have a field with a URL to a specific picture (JPG format). I have created a Picture Content Control inside the Word document, and I need to insert the picture into this control.

I don't want to save the picture in OneDrive or SharePoint. I want to insert it directly.

I hope someone can help 🙂

I have the same question (0)
  • fchopo Profile Picture
    8,001 Moderator on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    Hello @seryil 

    The image should be converted to base64 before passing its value to Word. So the steps would be:

    wordTemplate.png

     

    Hope it helps!

    Ferran

  • seryil Profile Picture
    18 on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    Hi @fchopo,

    Thank you for your reply. I tried it and it doesn't work. Will this method work for URL images? And how would you do it if it was through SharePoint (saving the image in SharePoint)?

  • Paulie78 Profile Picture
    8,418 Moderator on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    If I understand your question properly, you don't receive the image in your API response, only a URL. You will need to use the HTTP action first, with the URL that you receive in your API response to download the content of the image into your flow. You can then use the content from the HTTP request in your word connector and follow the instructions provided by @fchopo . Does that help? (The HTTP action is premium, so you will need a premium license).

  • seryil Profile Picture
    18 on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    Hi @Paulie78,

    The HTTP request is not a problem. I've fixed that.


  • seryil Profile Picture
    18 on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    @fchopo @Paulie78 

    The picture is inside of a repeating section content control in the Word Document. Could that be why it doesn't work?

  • fchopo Profile Picture
    8,001 Moderator on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    Hi @seryil 

    I don't really know the answer to your last question, but I would try the same flow and using another simple Word document, where time image control is not in a repeating section.

    Please, let us know if that's the problem!

    Regards,
    Ferran

     

  • seryil Profile Picture
    18 on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    Hi @fchopo 

    It seems that Word doesn't support images within a repeating section content control: Support Image Controls within the Repeating Sectio... - Power Platform Community (microsoft.com).


    But I think I can make a work around by saving the image in SharePoint and then replace the text in the table with the image stored in SharePoint. But I can't save the image I get from my API (URL image) in SharePoint. Is it something you can help me with?

    I get the following message:

    seryil_0-1618408614711.png

    Do I need to convert the URL to Base64?

     

  • fchopo Profile Picture
    8,001 Moderator on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    Hello @seryil 

    You should use dataUriToBinary function. Have a look at this sample (although I know your image is coming from an API and not from Power Apps): Taking a picture with PowerApps and sending to SharePoint with just Flow — John Liu .NET

    Hope it helps!

    Ferran

     

  • seryil Profile Picture
    18 on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    Hi @fchopo ,

    But shouldn't I convert the URL to dataUri first, before I can convert it to Binary?

    This is what I get from my JSON (string type):

     
    And I want to save this image to SharePoint 🙂




  • fchopo Profile Picture
    8,001 Moderator on at
    Re: Insert JPG file (Picture) from HTTP Request in Word document

    Hi @seryil 

    I've done this test on my side, and it's working:

    http_image.png

     

    Hope it helps!

    Ferran

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard