Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

populating word picture when file content empty

(0) ShareShare
ReportReport
Posted on 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

 

  • jkb6011 Profile Picture
    122 on at
    Re: populating word picture when file content empty

    This worked perfectly for me! Kudos!

  • Verified answer
    Paulie78 Profile Picture
    8,416 Super User 2025 Season 1 on at
    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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1