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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / how to check if attach...
Power Automate
Unanswered

how to check if attachment has been added or changed ?

(0) ShareShare
ReportReport
Posted on by 2
Hi,
 
I know I can check if a SPO list item has an attachment or not, but how do I check of a 2nd, 3rd,4th,... attachment has been added, respectively one of the attachments has been changed with  PowerAutomate flow ??

thanks alex.
Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at
    I don't know of a way to figure out what attachment has been added or removed, but I can help you figure out if they have been changed. Do this:
    1. Add an integer variable to your list named AttachmentCount and set the initial value to 0.
    2. Create a workflow that triggers when the item is created and modified.
    3. Add a condition where Has attachments is equal to true.
    4. On the yes side of the condition (if it has attachments), add a Get attachments action and configure it to the list item.
    5. Add a compose action and use a length expression to return the number of attachments from the Get attachments action: length(outputs('Get_attachments')?['body'])
    6. Follow this with a Get changes for an item or file action configured to the list item.
      1. Configure Since to Trigger Window Start
      2. Configure Until to Trigger WIndow End
      3. Trigger Window Start and End are listed in the Dynamic Content
    7. Add another condition to check if the AttachmentCount field in step 1 is NOT equal to the calculated attachment count from step 5. You'll want to pass both values through an int expression to prevent any errors.
      1. int(triggerOutputs()?['body/AttachmentCount'])
      2. int(outputs('Compose_Count_Attachments'))
    8. If it is NOT equal, that means an attachment was added or removed since the last save.
    9. On the yes side of the second condition, you would add an Update item action to update the AttachmentCount from step one with the value generated in step five. 
    Your flow will look like this (with the exception of the last action to update the list item with the new attachment count):
    ​​​​​​​









  • AF-02100940-0 Profile Picture
    2 on at
    Hi David
     
    this makes sense ! thanks a lot !
    What is the purpose of step 6) actually ? 
     
    ciao alex.
  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at
    Step six is the action that you can use to determine if the attachments have changed based on the AttachmentCount value. It gets the version history information from the flow run to the last version and returns true and false for the fields in the list as to whether the value has changed since the last version. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard