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?
Added in a condition for "Attachment Name" contains .xls
This took care of it.
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:
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.
Test email with several attachments:
Only '.xls' created in SPO.
Hope the content above may help you.
Best regards,
Anna
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.
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.
https://docs.microsoft.com/en-us/power-automate/email-triggers
https://docs.microsoft.com/en-us/connectors/office365/#get-attachment-(v2)
Hope that helps.
Best regards,
Anna
User | Count |
---|---|
6 | |
5 | |
3 | |
3 | |
2 |