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:
And I have found this article on this great forum:
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:
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.
In the condition I have this expression
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:
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
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
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
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
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:
The Filter Query from the Get Items action
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
Hi @Anonymous,
Could you try usingthe expression
length(body('Get_items')?['value'])
is equal to 0 for your condition as below?
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!