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

populating word picture when file content empty

Like (0) ShareShare
ReportReport
Posted on 1 Nov 2020 19:41:52 by 160

 

I am using word connector and generating word document with picture.

I get picture file content from sharepoint list and add to word.

 

There are cases when there is no image in a flow, then file content is empty or skipped. then i getting word connector error:

The image is not of type PNG or JPG. Please provide an image of type PNG or JPG.
clientRequestId: 993d78e1-2a41-4ac5-ac45-7c549d5e7838

 

How should i deal with empty file content in word connector?

 

opit_1-1604259544500.png

opit_0-1604259498793.png

 

I have the same question (0)
  • jkb6011 Profile Picture
    122 on 26 Apr 2022 at 20:44:10
    Re: populating word picture when file content empty

    This worked perfectly for me! Kudos!

  • Verified answer
    Paulie78 Profile Picture
    8,416 Moderator on 01 Nov 2020 at 20:39:49
    e: populating word picture when file content empty

    Initialize an object variable called "1x1 Image" with the following content:

    {
     "$content-type": "image/png",
     "$content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII="
    }

    Like this:

    1x1Variable.PNG 

    Then in the populate a word document step, instead of using the content from the get file action use this expression:

    if(empty(outputs('Get_file_content')?['body']), variables('1x1 Image'), outputs('Get_file_content')?['body'])

    PopulateWordCondition.PNG

    This checks to see if the output of your "Get File Content" action is empty, if it is then it supplies word with the 1x1 pixel image. If it is not empty then it supplies the output of the "Get File Content" action.

     

    Please...

    If I answered your question Accept it as a solution ✔️ 

    If I helped you out, please give me some Kudos 👍

    Thanks 😙

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…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 798 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 469 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 333

Last 30 days Overall leaderboard