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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create a condition to ...
Power Automate
Answered

Create a condition to check if attachments exist and only add new attachments.

(0) ShareShare
ReportReport
Posted on by 15

This flow copies the item and its attachments from one list to another, and also updates the migrated list when modified. The problem I'm having is that when someone adds a new attachment on the source list, its being added on the migrated list but the flow shows failed as it's also picking up the existing attachments. Looks like I need to add a condition to check and ignore the attachments that exist and only add the new ones when the source is modified. Would appreciate your assistance, thank you.

 

Paulcofla_1-1710051142300.png

 

Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Paulcofla 

     

    See the demo flow which helps to add attachments to a new list from existing list when item is created /Modfied.

     

    Assume we have two list - List12 and List13. The requirement is when item is created/Modified in List12 , item should be created/Modified in List13 respectively This flow would be with respect to attachments.

    see below

    1. use trigger 

    Nived_Nambiar_0-1710078764464.png

     

    2. use get attachments to get all attachments from a list item in list 12

    Nived_Nambiar_1-1710078813084.png

     

    3. Get items from List13 corresponding to item created/modifed in List12 if available.

    Nived_Nambiar_2-1710078856035.png

     

    (Here title is my unique identifier)

     

    4. Use condition to check whether the items are present as output from get items 

    Nived_Nambiar_3-1710078918500.png

     

    Expression - 

    length(outputs('Get_items')?['body/value'])
     
    If condition is True-
    Then item is created in List13 and attachments are also added from item in List12 to List13.
     
    Nived_Nambiar_4-1710078974762.png

     

     

    if condition is False- 

     

    in No branch do the following

     

    a. use get attachments to get details of attachments from List13 

    Nived_Nambiar_5-1710079037721.png

     

    Expression to get id -  first(outputs('Get_items')?['body/value'])?['ID']

     

    b. use apply to each to loop output of attachments obtained from get attachments details from List12.

    Nived_Nambiar_6-1710079111721.png

     

    Within the loop try like below

     b1- use filter array to check whether item in List12 is present in List13 or not ?

    Nived_Nambiar_7-1710079179218.png

     

    Nived_Nambiar_8-1710079202269.png

     

    Nived_Nambiar_9-1710079249009.png

     

    b2. write a condition like this to check output of filter has zero elements or not?

    Nived_Nambiar_10-1710079284173.png

     

    Expression -  length(body('Filter_array'))

     

    If condition is satisifed- follow the actions in Yes branch- 

    Nived_Nambiar_11-1710079346724.png

     

    Nived_Nambiar_12-1710079386924.png

     

    Next use add attachment  to attachment not present in List13

    Nived_Nambiar_13-1710079431625.png

     

    Expression -  first(outputs('Get_items')?['body/value'])?['ID']

     

    Nived_Nambiar_14-1710079485135.png

     

    Nived_Nambiar_15-1710079509956.png

     

     

    This is the design---

    Hope this helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

  • Verified answer
    Paulcofla Profile Picture
    15 on at

    Awesome, thank you very much for the prompt response!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard