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.
Awesome, thank you very much for the prompt response!
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
2. use get attachments to get all attachments from a list item in list 12
3. Get items from List13 corresponding to item created/modifed in List12 if available.
(Here title is my unique identifier)
4. Use condition to check whether the items are present as output from get items
Expression -
if condition is False-
in No branch do the following
a. use get attachments to get details of attachments from List13
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.
Within the loop try like below
b1- use filter array to check whether item in List12 is present in List13 or not ?
b2. write a condition like this to check output of filter has zero elements or not?
Expression - length(body('Filter_array'))
If condition is satisifed- follow the actions in Yes branch-
Next use add attachment to attachment not present in List13
Expression - first(outputs('Get_items')?['body/value'])?['ID']
This is the design---
Hope this helps !
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! 🙌