cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bill51106
Helper IV
Helper IV

Flow fails but succeeds

Flow issue.PNG

My flow works great to produce my results but says failed overall.

The email I receive contains 3 different file types. I only want the .xls, it errors out with cannot open document, invalid file type.

How can I add a condition before the conversion to only try to take the .xls file?

4 REPLIES 4
Bill51106
Helper IV
Helper IV

Added in a condition for "Attachment Name" contains .xls

This took care of it.Capture.PNG

Hi @Bill51106 

 

Thank you for posting.

 

According to your description, you would like to only save .xls file from received emails. If any misunderstanding, please kindly let me know.

 

We should add one more ‘get attachments’ action to get attachments details and modify flow as below:

v-duann-msft_0-1617172205985.png

 

Since we do have two different kinds of excel file whose extension name is ‘.xls’ and ‘.xlsx’. If you use contains ‘.xls’ as condition, flow will filter both types of excel. However, if you want ‘.xls’ only, we should use ‘ends with’ instead.

 

Once tested, I’m able to get ‘.xls’ file only.

v-duann-msft_1-1617172205991.png

 

Test email with several attachments:

v-duann-msft_2-1617172205994.png

 

Only '.xls' created in SPO.

v-duann-msft_3-1617172205995.png

 

Hope the content above may help you.

 

Best regards,

Anna

Bill51106
Helper IV
Helper IV

@v-duann-msft 

Thank you for taking time out and assisting me. I have updated my code.

Can you explain why I am doing it this way though? I added an additional step (Get Attachment v2). It adds and additional 7 seconds.

 

I would have though just changing my condition to Name / ends with / .xls would be enough?

Thank you, I am trying to understand each step as best as I can and will ask a lot of questions of why.

Capture.PNG

Hi @Bill51106 

 

Thank you for your update.

 

If we only check 'include attachment' & 'has attachment' in 'When a new email arrives' trigger, it only detects the presence of attachment but doesn't include the content details inside although we can find related parameter in dynamic content area. That's why we can't open created file and need one more 'get attachment' to obtain that content.

v-duann-msft_0-1617334986247.png

https://docs.microsoft.com/en-us/power-automate/email-triggers 

 

v-duann-msft_2-1617335056580.png

https://docs.microsoft.com/en-us/connectors/office365/#get-attachment-(v2)

 

Hope that helps.

 

Best regards,

Anna

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,798)