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

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?
 
 

Accepted Solutions
Community Support Team Rank
Community Support Team

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

anthony_leduc
Level: Powered On

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


All Replies
Community Support Team Rank
Community Support Team

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

Highlighted
anthony_leduc
Level: Powered On

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

 

 

Community Support Team Rank
Community Support Team

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

anthony_leduc
Level: Powered On

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
anthony_leduc
Level: Powered On

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
anthony_leduc
Level: Powered On

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

Community Support Team Rank
Community Support Team

Re: Filtering attachments

Hi @anthony_leduc,

 

Is your problem solved now?

Do you need further assistance?

 

Best Regards,

Barry

anthony_leduc
Level: Powered On

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?

 

 

Community Support Team Rank
Community Support Team

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

>