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 / Compare 2 SharePoint l...
Power Automate
Unanswered

Compare 2 SharePoint lists , and create item not there

(0) ShareShare
ReportReport
Posted on by 568

Hello everyone, 

 

I have been struggling for days and I hope someone can help me.

 

I have two SharePoint lists. Each list has a name. I need list number one to search list number two by name and if list number one name is not in list number two , create an item in list number three from list number two.

 

thank you for your help in advance. 

Categories:
  • Sahara22 Profile Picture
    568 on at

    Any help would be great please! 

  • AdrianTorres Profile Picture
    43 on at

    @Sahara22 I think you’re gonna have to give an example with some random list items to go through of the process you want to do.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Sahara22 ,

     

    Below is a solution that uses XML to compare two arrays and get differences. For your question, after getting the array of different items, apply to each value and create new items in list3.

    Solved: Re: Compare data between sharepoint list and excel - Power Platform Community (microsoft.com)

     

    Best regards,

  • S-Venkadesh Profile Picture
    1,229 Super User 2026 Season 2 on at

    Hi @Sahara22 ,

    To demonstrate the logic, let's consider two lists:

    List1 - Employee (Columns : Title (Built in Column))
    List2 - EmployeeTasks(Columns : Title (Built in Column), Task(Single line of Text)

    To achieve the desired outcome, follow these steps:

    1. Start a new automated cloud flow in Power Automate and set the trigger to "When a new item is created" in Employee (List1).
    2. Add a "Get items" action to retrieve all the items from EmployeeTasks (List2) with a filter query to match the Title from List1 with the Title in List2.
    3. Create a new variable using the "Compose" action to calculate the length of the output array.
    4. Use a "Condition" action to check if the length of the output array is less than 1 (if less than 1, then it means no matching record exists).
    5. In the "Yes" case of the "Condition" action, add a "Create item" action to create a new item in EmployeeTasks (List2) with the same Title from List1 and the relevant Task.

    Refer to the figure below for a visual representation of the flow.



    SVenkadesh_0-1681114998222.png

     


    Best Regards,
    Venkadesh Sundaramurthy






  • Sahara22 Profile Picture
    568 on at

    Thanks @S-Venkadesh and @v-jefferni ,

     

    So i need to search for names, sometimes the names may have something extra at the end like, John smith @123 , I need to use contains . so Employee name "contains" employee  name. 

     

    basically if names in list A is not in list B, create an item in list C, after done it sends a email of the list C  then gets deleted after the email is sent and starts fresh the next day. 

     

    I tried this filter but i still get duplicates, please see below :  this is a scheduled flow . 

     

    A9B4BEE1-2FE2-4DE0-97A8-C8D3314879CB.jpeg

  • S-Venkadesh Profile Picture
    1,229 Super User 2026 Season 2 on at

    Hi @Sahara22 ,
    To match text that contains a specific substring in a FilterQuery, you can use the following formula 

    substringof('searchtext',FieldName)

    E.g.

    SVenkadesh_0-1681161457244.png

     


    Please hit thumbs up, if it helps!

    Best Regards,
    Venkadesh Sundaramurthy

     

  • Sahara22 Profile Picture
    568 on at

    Ok will try this now , Also @S-Venkadesh  can I do this was a schedule? or has to be create an item? i just notice i get to many loops

  • Sahara22 Profile Picture
    568 on at

    It's not working @S-Venkadesh 

     

    I get an error : 

     

    Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language expression 'length(outputs('Get_items_2')?['body/value'][0]['field_1'])' cannot be evaluated because property 'body/value' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

     

    13AE4E5C-2F0C-4795-8258-69D854EE4C97.jpeg

  • Sahara22 Profile Picture
    568 on at

    any ideas?

  • takolota1 Profile Picture
    4,980 Moderator on at

    @Sahara22 

     

    Did you try

    length(string(outputs('Get_items_2')?['body/value']))

    ??

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 159

Last 30 days Overall leaderboard