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 - Building Flows
Answered

getting specific items with attachments from library and sending email based on sharepoint list

(0) ShareShare
ReportReport
Posted on by 102

Hi there,

I have built a flow where it gets attachments based on certain IDs.

I have a list and a document library where the files are stored.

The list is used to get the APAC IDs and email of who should get what file.

The flow is working but what i am having issues with is that if there is no file attachment in the library for a APAC ID then it should skip. The below flow will still send an email to the person regardless if it has a file or not. Have tried to add the condition if no attachment do nothing but no luck

 

BianceBee_0-1692259048770.png

BianceBee_1-1692259103092.png

BianceBee_2-1692259186272.png

Below are the columns of the sharepoint list

BianceBee_3-1692259274996.png

Library of where the files are stored

BianceBee_4-1692259300363.png

 

 

 

 

I have the same question (0)
  • ManishSolanki Profile Picture
    15,089 Super User 2025 Season 2 on at
    Re: getting specific items with attachments from library and sending email based on sharepoint list

    Hi @BianceBee 

     

    Pls try to add a condition action before sending email which will check if list item contains an attachment or not. If yes, then send an email in the "Yes" section:

    ManishSolanki_0-1692424330137.png

    You can locate the "Has attachments" property of the current iterated item from the Dynamic content window.

     

    Use expression for the right-hand operand. Expressions are entered in the expression window as highlighted below:

    ManishSolanki_1-1692424524879.png

    Expression used in above screenshot:

    true

    If the condition is true, then send the email to the required recipients.

     

     

    If this helps & solves the problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • BianceBee Profile Picture
    102 on at
    Re: getting specific items with attachments from library and sending email based on sharepoint list

    Hi @ManishSolanki  unfortunately this will not work as the list does not contain the attachment it is in the library document. I created a array so it gets the attachment from the library by the name (same as apac id) and then filter the array so that from the list it sends the email to the correct person using the APAC ID. 

  • Verified answer
    ManishSolanki Profile Picture
    15,089 Super User 2025 Season 2 on at
    Re: getting specific items with attachments from library and sending email based on sharepoint list

    Hi @BianceBee 

     

    I catch the issue now. You need to check if the "Filter array" action returns any record or not. If records are returned, then we will send an email to the required user:

     

    You need to add "Condition" action after "Filter array 2" action and check the length of the array returned by filter action. If the length is greater than one, then send an email. For checking the length of an array, you need to write an expression using length() function. Expressions are added in the separate expression window as highlighted in the below screenshot:

    ManishSolanki_0-1692542768490.png

    Expression used for calculating the length of an array:

    length(body('Filter_array_2'))

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • BianceBee Profile Picture
    102 on at
    Re: getting specific items with attachments from library and sending email based on sharepoint list

    You are a legend @ManishSolanki  thank you 🙂

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 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard