web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Filtering attachments

(0) ShareShare
ReportReport
Posted on by

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?
 
 
I have the same question (0)
  • v-bacao-msft Profile Picture
    on at
    Re: Filtering attachments

    Hi @Anonymous,

     

    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 Power Platform Member Profile Picture
    on at
    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

     

     

  • v-bacao-msft Profile Picture
    on at
    Re: Filtering attachments

    Hi @Anonymous,

     

    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 Power Platform Member Profile Picture
    on at
    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
  • Community Power Platform Member Profile Picture
    on at
    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
  • Community Power Platform Member Profile Picture
    on at
    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

  • v-bacao-msft Profile Picture
    on at
    Re: Filtering attachments

    Hi @Anonymous,

     

    Is your problem solved now?

    Do you need further assistance?

     

    Best Regards,

    Barry

  • Community Power Platform Member Profile Picture
    on at
    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?

     

     

  • Verified answer
    v-bacao-msft Profile Picture
    on at
    Re: Filtering attachments

    Hi @Anonymous,

     

    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

  • Verified answer
    Community Power Platform Member Profile Picture
    on at
    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard

Featured topics

Restore a deleted flow