I've looked for the answer across this forum but can't see one for this specific issue. I've attached photos to explain my flow and where it's going wrong, but in summary this is what I want to do.
Compare two SharePoint Lists, List A and List B - both lists have a column A which has a unique reference number (eg. VPT12345678). List A is a feed of records, however some of those records will already be on List B, so I only want the new records. So, what I am aiming to do, is compare List A and List B via column A (both are title columns and are single line of text), ignore where they match and add in new records where they don't match. I am trying to achieve this via the Filter Array that also uses the condition of length(body('Filter_array')) equals 0, to identify the records that don't match. In this case to test it, I have 12 records on List A, 1 of those is new and 11 are already on List B, so I should in theory only have 1 new record added to List B. However, it is adding all 12 records to List B resulting in 11 duplicates. It looks to me like the array to find a match is not working, but I don't know why?
I'd appreciate someone looking at this for me and giving me some steer, because I am new to this. But really want to learn.
Good spot, I do remember selecting the wrong one and taking it out and correcting it, but the damage may have been done. I will go check and if this is the fix I will mark as solved! Thanks for getting back so quickly.
How did you end up with the second Apply to each where it is creating an item?
Apply to each 1 should be using the values of List A. For each row in List A it is going to Filter Array the List B Get Items and see if the value is in there using the condition. If the condition shows there is zero 0 length, then it is Yes; therefore create a new item on List B using the current value from Apply to Each 1 from List A.
I don't see why an Apply to Each 2 would be in the create item. It should just be using the current single item from Apply to Each 1 from List A.
That is probably the error. Without seeing exactly the value source of the Apply to Each, I can't confirm what exactly it is doing, but try to remove that and see if it works.
I'm guessing you inserted the Create Item step, and then you accidently put in a value from the Get Items 2, and it automatically made it Apply to Each 2.
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional