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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / populating word pictur...
Power Automate
Answered

populating word picture when file content empty

(0) ShareShare
ReportReport
Posted on by 162

 

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

 

Categories:
I have the same question (0)
  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    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 😙

  • jkb6011 Profile Picture
    122 on at

    This worked perfectly for me! Kudos!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard