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?
This worked perfectly for me! Kudos!
Initialize an object variable called "1x1 Image" with the following content:
{
"$content-type": "image/png",
"$content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII="
}
Like this:
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'])
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 😙
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2