Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

list item duplicates values based on when new email arrives based on subject values

(1) ShareShare
ReportReport
Posted on by 2,245

When new email arrives im extracting subject values and storing it in the list item 

Incoming email sample

Subject:USA,Client9

So if they are using same subject values but different attachments then it should update document library for the new attachment but at list item level it should not create new item as per below, so how to prevent duplicity in this context.

Veblitz_0-1721045396910.png

 

 

 

Flow details

Veblitz_1-1721045396902.png

 

 

Veblitz_2-1721045396887.png

 

 

How to prevent duplicates in the list item and in my case if the subject has same values then how to restrict those items 

Veblitz_3-1721045396914.png

 

 

set country variable expression:
last(split(outputs('Compose')[0],': '))
set customer variable expression:
last(split(outputs('Compose')[1],': '))

Veblitz_4-1721045396917.png

 

 

  • Veblitz Profile Picture
    2,245 on at
    Re: list item duplicates values based on when new email arrives based on subject values

    Thanks a lot for your awesome support and detailed information. Fantastic.

  • Veblitz Profile Picture
    2,245 on at
    Re: list item duplicates values based on when new email arrives based on subject values

    Okay.

    I will try the same but I'm not sure if I understood fully and what I mean partially is that how to use expressions inorder to compare get items attachments and get attachments actions values into an array variable .kindly shed some light.

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: list item duplicates values based on when new email arrives based on subject values

    Hi,

     

    In no branch, you may compare the email attachments with attachment present in output of "Get items" action. Use "Get attachments" action from SharePoint connect and compare its name with attachment name in condition action. You need to use nested loop to perform the comparison. Use string or array variable to store the comparison result for each attachment. Post comparing, check string or array variable value and accordingly save attachment or email in document library.

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

     

  • Veblitz Profile Picture
    2,245 on at
    Re: list item duplicates values based on when new email arrives based on subject values

    I tried but no luck,

     

    here is my flow run history

     

    Veblitz_0-1721049944595.png

    Veblitz_1-1721049997230.png

     

    Veblitz_2-1721050069531.png

     

     

  • Veblitz Profile Picture
    2,245 on at
    Re: list item duplicates values based on when new email arrives based on subject values

    As per my above flow steps this is the complete flow details and i added get items as per your inputs and tested by sending same email subject but different attachments but in my flow duplicate items were not added which is correct but at the same time email attachment is different and that is skipped and so in my case its working No condition.so what i mean is that in my flow it work partially though your inputs were perfect but im not aware where to place get item actions logically in order to skip through this new issue where different attachment for the same email subject is ignored.

     

    Kindly advise

    Veblitz_2-1721048903863.png

    Veblitz_3-1721048944010.png

    Veblitz_4-1721048997243.png

    Veblitz_6-1721049131838.png

     

     

     

     

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: list item duplicates values based on when new email arrives based on subject values

    Hi @Veblitz 

     

    Use "Get items" before "Create item" action, apply filter query in get items to check if item with customer & country already exists in it. You need to use odata query for both columns i.e. country & customer.

     

    Add "Condition" action to check the length of output array return by "Get items" action using an expression. If output contains any element then update item else if output is empty then create item.

     

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

     

  • Pstork1 Profile Picture
    66,824 Most Valuable Professional on at
    Re: list item duplicates values based on when new email arrives based on subject values

    If you don't want duplicates then you need to use Update Item to update the existing item instead of Create item to create a new one. So you need to check the subject against all the items to see if one matches before doing either the Create Item or Update Item.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >