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 Apps / Avoiding Duplicates in...
Power Apps
Unanswered

Avoiding Duplicates in SharePoint List from Microsoft Accounts Using Power Automate

(0) ShareShare
ReportReport
Posted on by 20

Hi everyone,

I've set up a flow in Power Automate to add the names, cities, and workplaces of my colleagues to a SharePoint list using their Microsoft accounts, and it's working well. However, I'm encountering a challenge: whenever a new team member joins, I want to add them to the list. As of now, when I rerun the Power Automate flow, it creates duplicates for everyone already in the list. I would like to know how to avoid these duplicates every time the flow is triggered. Any advice or solutions would be greatly appreciated.

My Flow is in the attachments,

Thank you!

powerautomate.png
Categories:
I have the same question (0)
  • Sickle-Cell Profile Picture
    600 Super User 2024 Season 1 on at

    Hi @Adouz,

     

    I'm not confident in my grasp of the french language enough to read the specifics of your flow, but I can tell you the rough idea of what you'll be looking to do.

     

    At some point during your flow - likely during the Apply to Each action - you'll need to implement a Condition step that checks each existing unique value within your current list (maybe email addresses?) and compare that to the input. Then you set up the flow to only create a new item where that value doesn't exist, which should prevent duplicates.

     

    Hope this helps, let me know if you need anything further.

  • Adouz Profile Picture
    20 on at

     

    Thank you for your suggestion about using a Condition step in Power Automate to prevent duplicates in my company directory. I understand the concept of implementing a Condition to check each unique value (such as email addresses) against the input to avoid creating duplicate entries. However, I'm facing a challenge in applying this in practice.

    Since I am retrieving all attributes of each user, these attributes always exist, making it unclear how to effectively use the Condition step to identify and prevent duplicates. As someone new to Power Automate, I'm finding it a bit complex to navigate.

    I attempted to follow this approach, but unfortunately, it didn't work as expected. Could you please provide some more detailed guidance or examples on how to correctly set up this Condition step in the flow? Any step-by-step instructions or tips specifically tailored for beginners would be incredibly helpful.

    Adouz_1-1700055837651.png

     

  • Sickle-Cell Profile Picture
    600 Super User 2024 Season 1 on at

    Hi @Adouz,

     

    Not sure it's exactly step by step and I might be mistaken in my assumptions but please correct me if I'm wrong. I'm assuming the values will exist in the filter table but not the sharepoint list, initially. 

    So what you have now is good, after the Define a Variable step, you would need a Get Items step to look up all the items currently in your list. Then you would need another Apply to All based off the output of that, then have your current Condition and Create Item as you have it there.

     

    The condition would then be taking a unique field from your table and comparing it to the same field in your Sharepoint to check if they exist. On a no, it should do nothing, but when it finds a new employee, it should add them in. The exact wording would depend on your field names but something like this. Substitute the Email part for whatever your table/Sharepoint field names are. 

    items('Apply_to_each')?['Email'] equals items('Apply_to_each_2')?['Email'].

    Another, less conventional option would be to allow the flow to run exactly as you have it, duplicating the records, then have a Apply To Each loop with a Delete File that removes the duplicates. 

  • Adouz Profile Picture
    20 on at

    Thank you for your patience and guidance. I am able to identify the block that needs to be added in Power Automate for implementing the Condition step. However, without visual references, I'm struggling to understand exactly what to input and where to place it in the flow. My understanding of English is not the best, which adds to the challenge.

    If possible, could you provide screenshots or diagrams ?

     

    Your assistance in this learning process is greatly appreciated.

    Thank you once again!

  • Sickle-Cell Profile Picture
    600 Super User 2024 Season 1 on at

    Hi Adouz,

     

    No problem, I just hope I'm helping in some way!

    I've attached some images that might explain what I mean better. I've replicated as close as I can as I'm not sure what you have in your variable step and so on - that variable step might be able to be removed once we figure out how best to lay it out. 

    Tables.PNG
    Tables2.PNG
  • Adouz Profile Picture
    20 on at

    Hello @Sickle-Cell , I'm only responding now as I haven't had the chance to continue recently. I'm still stuck at the same spot and am unsure about what to include in the screenshots I've provided you with.

    Here is the condition,  I'm sorry for not being able to do it. 😥

    a7255eed-aca9-4dbc-8f79-686d8b916892.png

     

    Last way is  "to Another, less conventional option would be to allow the flow to run exactly as you have it, duplicating the records, then have a Apply To Each loop with a Delete File that removes the duplicates." 

    If you can help me with that, 

    APPLYT TO EACH.png
    GET ITEM.png
    SHAREPOINT LIST.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 493 Most Valuable Professional

#2
11manish Profile Picture

11manish 479

#3
Haque Profile Picture

Haque 328

Last 30 days Overall leaderboard