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 : h6TpBIv8bNcSmFvLTUYWFZ
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

 

  • 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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

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!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2