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

Notifications

Announcements

Community site session details

Community site session details

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard