cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
terpsbmore
Level: Powered On

blank images sharepoint

Hello All,

 

I am having an issue where my flow is saving a blank image to a SharePoint document library.

 

I have a simple flow that monitors an Outlook Inbox and saves an email attachment (excel file) to the library if the email meets certain criteria. When I initially created the flow it was only storing the excel file correctly to the library. I receive the excel file every day and it always has the same name so I needed a way to store all files instead of them being replaced every night. In order to achieve this, I added dynamic data to the front of the file name attribute. If I add anything to the end of the file name it changes the file type and I need it to be an excel file. The flow still works after I made the change however it now stores a corresponding blank jpeg file with every file.

 

Does anyone know why this is happening and how to stop the flow from saving the jpeg?

 

Any help is much appreciated.

 

AG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: blank images sharepoint

Hi @terpsbmore,

 

Could you please share a screenshot of your flow's configuration?

Do you want to add some dynamic content to the front of the file name of the Excel file?

 

I assume that you want to add current date to the front of the file name of the Excel file, I have made a test on my side, please take a try with the following workaround:

  • Add a "When a new email arrives" trigger, Has Attachment field and Include Attachments field are both set to Yes.
  • Add a "Apply to each" action, input parameter set to Attachments dynamic content of the trigger.
  • Within "Apply to each" action, add a "Create file" action, specify Site Address and Folder Path, File Name field set to following formula:
concat(utcNow('yyyy-MM-dd'),'_',split(item()?['Name'],'.')[0],'.',split(item()?['Name'],'.')[1])

Note: The split(item()?['Name'],'.')[0] expression returns the file name without extension name, the split(item()?['Name'],'.')[1] expression returns the file extension name (e.g. .xlsx).

 

File Content field set to Content dynamic content of the trigger.

 

Image reference:11.JPG

The flow works successfully as below:12.JPG

 

13.JPG

 14.JPG

 

 

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support Team
Community Support Team

Re: blank images sharepoint

Hi @terpsbmore,

 

Could you please share a screenshot of your flow's configuration?

Do you want to add some dynamic content to the front of the file name of the Excel file?

 

I assume that you want to add current date to the front of the file name of the Excel file, I have made a test on my side, please take a try with the following workaround:

  • Add a "When a new email arrives" trigger, Has Attachment field and Include Attachments field are both set to Yes.
  • Add a "Apply to each" action, input parameter set to Attachments dynamic content of the trigger.
  • Within "Apply to each" action, add a "Create file" action, specify Site Address and Folder Path, File Name field set to following formula:
concat(utcNow('yyyy-MM-dd'),'_',split(item()?['Name'],'.')[0],'.',split(item()?['Name'],'.')[1])

Note: The split(item()?['Name'],'.')[0] expression returns the file name without extension name, the split(item()?['Name'],'.')[1] expression returns the file extension name (e.g. .xlsx).

 

File Content field set to Content dynamic content of the trigger.

 

Image reference:11.JPG

The flow works successfully as below:12.JPG

 

13.JPG

 14.JPG

 

 

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

terpsbmore
Level: Powered On

Re: blank images sharepoint

@v-xida-msft I updated my flow and am no longer experiencing the image attachment. Though I am not sure why it happened in the first place.

 

I will try the workaround you provided because the "Received Time" dynamic content might not be the best when consuming the data via Power Query/PBI. I will let you know how it works out.

 

Thanks,

 

AG

terpsbmore
Level: Powered On

Re: blank images sharepoint

@v-xida-msft The time formatting worked great and kept the file type!

 

thank you!

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Kudoed Authors
Users online (5,030)