cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Filtering attachments

Hi,

I have a flow that can be used to retrieve attachments from a email address.
These attachments are automatically copied to a SharePoint site.
I would like to recover only attachments whose extension is JPG and JPEG.
The condition I set up does not work.
Can you help me?
 
 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Filtering attachments

Hi @anthony_leduc,

 

First you have to check if you have created other similar Flows before, but don't filter any type of files, they will be saved to SharePoint library.

Alternatively, you could try changing the language in Settings.

73.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
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

Highlighted
Frequent Visitor

Re: Filtering attachments

 
Finally.
It came from the destination directory. I removed the space and I replaced by _.
I also added step if the condition is not valid in order to drop all files other than JPG, JPEG in the Recycle Bin directory.
And everything works perfectly.
 
THANK YOU ^^
 

Annotation 2018-12-11 102733.jpg

View solution in original post

10 REPLIES 10
Highlighted
Community Support
Community Support

Re: Filtering attachments

Hi @anthony_leduc,

 

You could use "end with" to determine if the attachment name ends with "JPG" or "JPEG".

Formula reference:

@or(endswith(items('Apply_to_each')?['Name'], 'JPG'),endswith(items('Apply_to_each')?['Name'], 'JPEG'))

43.PNG

Please take a try.

 

Best Regards,

Barry

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

Re: Filtering attachments

Hi @v-bacao-msft and thank you for your tips.

 

I add the formula reference but when i want to save my flow i have this error 

 

La validation du modèle a échoué " La ou les actions de répétitions "Apply_to_each" référencées par "inputs" dans l'action "conditions" ne sont pas définies dans le modèle

 

What does it means ? 

 

Link

 

And another question : How do you embeddebd picture in this forum ?

 

Thank you

 

 

Highlighted
Community Support
Community Support

Re: Filtering attachments

Hi @anthony_leduc,

 

Because the language you set is French, some of the expressions inside need to be French.

You could try this formula below:

@or(endswith(items('Appliquer_à_chacun')?['Name'], 'JPEG'),endswith(items('Appliquer_à_chacun')?['Name'], 'JPG'))

As for how you add images, you could click on "Photos" or "Attachments" to upload images.

47.PNG

Please take a try.

 

Best Regards,

Barry

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

Re: Filtering attachments

I'm going to go crazy. I try the formula with french expression. I was able to save the flow. However, filtering does not work. I sent an email containing photos, a pptx file, zip, Word and PDF and they are well copied into the SharePoint Finally, with Edge, I don't have the attachments option when I click Capture. I tried with Firefox and it's the same
Highlighted
Frequent Visitor

Re: Filtering attachments

It's very Strange. I sent a mail with an attachment of type PNG. It is copied to the share point site. https://1drv.ms/u/s!AoEBGFd4Hq6IwtJoLMoIG-EnrfLisQ I checked the history and i saw this The annotation. png file is detected in the mail https://1drv.ms/u/s!AoEBGFd4Hq6IwtJp0IANiVMKFLuWzQ The condition is considered false because the file is of type PNG. As a result, it should not be created. https://1drv.ms/u/s!AoEBGFd4Hq6IwtJqP_liwkCSfo-zHA The flow seems to work but the PNG file is copying anyway. So I don't understand why it doesn't work
Highlighted
Frequent Visitor

Re: Filtering attachments

I just found out why I can't send images to the site.

You must disable the Controlled Access folder option to be able to send images to the site

 

Annotation 2018-12-07 233015.jpg

It's really a shame to have to do it.

 

On the other hand on the site https://techcommunity.microsoft.com/, I do not need to disable the functionality

Highlighted
Community Support
Community Support

Re: Filtering attachments

Hi @anthony_leduc,

 

Is your problem solved now?

Do you need further assistance?

 

Best Regards,

Barry

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

Re: Filtering attachments

No unfortunately.

My flow.

flow1.jpg

 

 

 

 

 

 

 

 

If I send an email containing these attachments

email.jpg

 

 

 

 

 

 

 

 

 

I check in the Sharepoint Site. I  can see that the documents of type PNG, zip, PDF

SP.jpg

 

 

 

 

 

 

I'm going back to my flow and i select the last action

last ation.jpg

 

 

 

 

 

 

 

 

 

The result indicates that the formula works

false.jpg

 

 

 

 

 

 

But this is not true as you could see.

 

I don't know what to do now 😞

Is it related to the French language? How to switch in English?

 

 

Highlighted
Community Support
Community Support

Re: Filtering attachments

Hi @anthony_leduc,

 

First you have to check if you have created other similar Flows before, but don't filter any type of files, they will be saved to SharePoint library.

Alternatively, you could try changing the language in Settings.

73.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
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

Highlighted
Frequent Visitor

Re: Filtering attachments

 
Finally.
It came from the destination directory. I removed the space and I replaced by _.
I also added step if the condition is not valid in order to drop all files other than JPG, JPEG in the Recycle Bin directory.
And everything works perfectly.
 
THANK YOU ^^
 

Annotation 2018-12-11 102733.jpg

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Users online (8,172)