I'm trying to write a flow to save Excel files that are sent as email attachments to a SharePoint folder. Excel files are being saved, emails where there are no excel files included are rejected, but my problem is that I can't seem to exclude other types of files included alongside an Excel file in an email, e.g. if there's an image in the email signature, that's being saved too.
Hi @datalyn
You should use a condition on file extension before saving it SP folder if it xlx or xlsx. let me know if you need help to create the condition.
Regards,
DS
Hi @DeepakS
That's what I've been trying to do. I'm using
@endswith(items('Apply_to_each_2')?['name'], '.xlsx')
but I can't work out how to make the next step, 'create file in SharePoint', apply only to those files that meet that criteria. At the moment if the condition is met its saving all the attachments in the email.
Hi @datalyn
If i understood you correctly you are getting multiple files in single email? can you share a screen of you flow?
Regards,
DS
Yes, sometimes multiple Excel files, sometimes just one Excel file but also other attachments like images in the email signature for example.
Hi @datalyn
Here is an example that i would suggest to use , i would use split function to get the type and compare it :
That produces the error message -
Hi @datalyn
you should use the "apply to each" loop name as per your flow, based on your screen you should use:
split(items('Apply_to_each_2')?['name'],'.')[1]
You need to upload the excel first to one-drive or share point than access to read the cell value. i dont think you can read it same flow.
Regards,
DS
Hi @DeepakS
"The power flow's logic app flow template was invalid. The property 'expression' 'split(items('Apply_to_each_2')?['name'],'.')[1]' of template action 'Condition' at line '1' and column '520' is not a valid template language expression."
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
70 | |
22 | |
18 | |
17 | |
13 |
User | Count |
---|---|
126 | |
37 | |
30 | |
28 | |
26 |