Skip to main content

Notifications

Power Automate - Using Flows
Answered

Copy items between two SharePoint lists

(0) ShareShare
ReportReport
Posted on by

Hi all.

 

I have a problem copying data between two SharePoint lists, and I cannot figure out what causes the problem. I have two SharePoint lists (SharePointBooks and SharePointBooksDestination). When a new item is created in SharePoint Books or modified, i Want the changes to be updated in the SharePointBooksDestination list.

 

I have read a ton of documentation for example this one from MS:

MS support article

And I have found this article on this great forum:

https://powerusers.microsoft.com/t5/Building-Flows/Copying-items-between-lists-using-filtering/m-p/269629#M27390

 

The last article gave me some good hints, and it works almost perfect. The challenge is that, no matter if I create or modify a item in the SharePointBooks list, it will always create a new item in the destination list. This should only happen whaen I create a new list item. I have some pictures of the flow:Flow01.PNG

I have a column in the destination list (MasterID) where I store the ID from the SharePointBook list, and I use these as a filter.Flow02.PNG

In the condition I have this expressionFlow03.PNG

And i the value I have this expression.

When I look at the flows that has been running, they all seems to create a new item, no matter what, and I can see from the flows that has been running, that the body is empty. Se below:Flow04.PNG

Does anyone knos how to fiks this? The flow works fine with no errors, but I only need to create new list items when the item is not in the destination list.

 

Greetings From Denmark

/Frank

  • Re: Copy items between two SharePoint lists

    Hi @jwhite and sorry for writing again, but I have another issue with this challenge that i can not figure out.

     

    In the parent list I have a checkbox, and it shoud only be items were the value in the checkbox is equal to True that shoudl be copyed to the destination list. I have tried to make a AND/OR condition in Flow but it seems not to help. In need this:

     

    Parent list
    If an items is created or modified AND the checkbox is equal to True

    1. Chek if the items exists in the Destination list
    2. If not - create item
    3. If it exist - update item

    Hope you understand my challenge here. Do you have any suggestion to a solution? I can not figure out why a simple condition will not work for me 😞

     

    /Frank

     

  • Re: Copy items between two SharePoint lists

    UPDATE UPDATE UPDATE

    Hi again @jwhite. I do not know what I did, but suddenly the flow seems to work as intended from your suggestion. I am SO happy. I have spent hours and hours to make it work.

     

    Have an awesome day

     

    /Frank

  • Re: Copy items between two SharePoint lists

    Hi @jwhite and THX for quick reply. I have tried your solution, but it still keeps going on with creating a new item instead af updating the existing item 😞

     

    I have changed the Filter Query to "Title eq 'Title' (from Dynamic content).

    The output from the trigger:Flow05.PNG

     

    The Filter Query from the Get Items actionFlow06.PNG

    So I am a bit frustrated right now. The condition says, that if the expression length(body('Get_items')?['value']) is equal to 0 then create a new item, but it still creates new items when I make changes to existing items.

     

    I have tried to change the value in the condition to true, but it does not change anything :(:(:(

     

    /Frank

  • Verified answer
    jwhite Profile Picture
    jwhite 191 on at
    Re: Copy items between two SharePoint lists

    Hi @Anonymous,

    Could you try usingthe expression

    length(body('Get_items')?['value'])

    is equal to 0 for your condition as below?

    LengthCondition.png

     

    This is essentially checking the length of the array returned by your filter query. If there are not items returned, the length should be 0.

    Let me know if this helps, if it doesn't I'm sure we can figure something else out!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard

Featured topics

Restore a deleted flow