cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Send an email when a duplicate value is found in a specific column

Hi I've spent a long time trying to get this flow to work.

 

i want an email to be sent when a sharepoint list is updated, if there is a duplicate value in a specific column on the sharepoint list. (column : 'Account_x0020_number'). I want the email(s) to put the Title column and account number of the sharepoint list in the body of the email.

 

I've tried numerous ways of doing this, but nothing seems to work. another thing that complicates matters is there are null values in the column and ne null doesn't seem to work as a filter query for some reason. I suppose I need to do a filter array on this, but I can't get that to work either. 

 

Does anyone have any ideas on how to get this to work. 

 

Thanks,

 

1 ACCEPTED SOLUTION

Accepted Solutions

Anyway, I worked it out. 

 

BenBennett321_0-1706632302805.png

When an item is modified on my sharepoint list it checks that the value in the specified column matches already on the sharepoint list, (using the filter array) .

 

The Select part just gets the certain columns from the list to identify the duplicates, turns it into a Html table which is put into the email.  The Compose action is just to add some CSS to make the html table more attractive.

 

Thank you to myself.

View solution in original post

5 REPLIES 5

@BenBennett321 Have you considered toggling on Enforce unique values in your SP column. This will prevent duplicate values from being entered.

creativeopinion_0-1706289388829.png

You might be interested in this YT Tutorial: 5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows

 

In this tutorial I cover:

 How to troubleshoot a false Condition action result

 How to get dynamic content when it isn’t selectable from the list of dynamic content

 How to troubleshoot an Apply to Each action that isn’t looping through

 How to troubleshoot a skipped Apply to Each action

 How to troubleshoot a Filter Query

 How to use a SharePoint yes/no column in a Filter Query

 How to use Compose actions to troubleshoot a Power Automate flow

How to troubleshoot multiple emails being sent

 How to troubleshoot multiple Teams messages being sent

 

Hope this helps!


If I helped you solve your problem—please mark my post as a solution .
Consider giving me a 👍 if you liked my response! 

👉 Watch my tutorials on YouTube
👉 Tips and Tricks on TikTok

 

Hi Creative Opinion, thanks for that, but i only want to flag if there is a duplicate, I don't want to necessarily prevent them. I just need to do an additional check if there is a duplicate in that field. 

 

Thanks, 

@BenBennett321 No worries. Tip: Remember to rename your actions to keep your flow organized!

Trigger Condition (Optional)

If you'd like to only trigger your flow when an item is modified—you can add a trigger condition to your flow. When a New Item is Created the Version is 1.0.

creativeopinion_0-1706387119314.png

 

You can use that to differentiate between when an item is created or when it's modified.

 

To only trigger an item when it's modified, you'll need to compose an expression. First, add a Compose action to your flow and insert the Version number dynamic content from your flow trigger.

creativeopinion_1-1706387149531.png

Click on the three dots and select Peek Code.

creativeopinion_2-1706387181432.png

Copy the expression after the @ symbol and before the closing double quotes to your clipboard.

creativeopinion_3-1706387219422.png

Click on the three dots of the trigger conditions and select Settings

creativeopinion_4-1706387248074.png

Scroll down to the Trigger Conditions. You'll need to include an @ symbol at the start of a trigger condition expression. 

 

First insert the not() function.

creativeopinion_6-1706387316492.png

In between the not() function insert the equals() function. 

creativeopinion_7-1706387346824.png

In between the equals() function paste the expression from your clipboard.

creativeopinion_8-1706387370555.png

Add a comma, then insert a 1.0 between single quotes. This expression will only trigger the flow if the version is not equal to 1.0 (aka the item was not just created).

creativeopinion_9-1706387397348.png

Run a test. First, create a new item in your SP list. The flow should not trigger. Then modify an existing item. The flow should trigger. 

creativeopinion_10-1706387441167.png

Get Changes for the SP Item

Add a Get changes for an item or a file (properties only) action to your flow. In the ID field, insert the ID dynamic content from the flow trigger. In the Since field, insert the Trigger Window Start Token dynamic content from the flow trigger.

creativeopinion_11-1706387716051.png

You've indicated in your original post that you only want to send a notification a specific column has changed. To do this you'll need to check if the column has changed before continuing on with your flow. 

 

For testing purposes while building the flow, add a Compose action to your flow. Insert the Has Column Changed: [Your Account Number Column] dynamic content. For my SP List, it's the Has Column Changed: Custom ID dynamic content. 

creativeopinion_12-1706388022515.png

Run a test. Make a change to the Account Number Column. Review the output of the Compose action. The Compose action should output true

creativeopinion_13-1706388322343.png

Condition Check

Add a Condition action to your flow. Insert the output from the Compose action above into the first value field. This is why naming your actions is important. Especially when you have multiple instances of the same action. It makes it easy to identify which dynamic content belongs to which action. 

 

Leave the operator to is equal to. Enter true into the second value field. 

creativeopinion_14-1706388439298.png

 

Add the rest of your actions into the YES branch. The flow will only perform those actions if the Account Number column has changed. If not, then nothing will happen.

Send an Email (V2)

Whenever you are building a flow that sends an Email or Teams message, always use your email address in the recipient field until you've confirmed your flow is working as expected. Once your flow is ready to go you can replace your email address with the email address of the actual recipient. 

creativeopinion_15-1706388828924.png

Personally, I like to insert the email address of the actual recipient into the Subject line or Email/Message Body while I'm building and testing my flow. 

 

Compose your subject line and insert any dynamic content from your flow trigger if that suits your requirements.

creativeopinion_16-1706388882661.png

Add any static text and dynamic content into the email body.

creativeopinion_17-1706389011046.png

Run a test. Review the outputs of your email and ensure it's what your expecting. Adjust your email format until you are happy with it. Once you've confirmed everything looks good and your flow has been tested a few times. You can replace the recipient with the appropriate recipient.

 

If you are looking for a way to send multiple SharePoint List items that have been assigned to a user in an email—check out this YT Tutorial: How to Send a SINGLE EMAIL ✉️ with multiple SharePoint list items | Build THIS Power Automate Flow

In this tutorial I cover:

 How to send multiple list items in a single email with a Power Automate Flow

 How to create a dynamic date range

 How to use the Convert Time Zone action

 How to use a Filter Query in the Get Items action

How to count number of items in an array

 How to use the Select action to extract a users display name and email address

 How to create a unique list of email addresses

 How to use the Create HTML Table action

 How to customize the HTML Table with CSS styles

How to use the Send an email (V2) action

How to use the Append to String Variable action

How to create a custom list of items for an email

How to use the Send an email (V2) action

How to display singular or plural text based on the number of items returned

 

 

Hope this helps!

If I helped you solve your problem—please mark my post as a solution .
Consider giving me a 👍 if you liked my response! If you're feeling generous— ️  Buy me a coffee: https://www.buymeacoffee.com/acreativeopinion

👉 Watch my tutorials on YouTube
👉 Tips and Tricks on TikTok

 

 

 

Thanks for this detailed response, but I can't see in your flow where it looks for duplicates? it seems to be only looking for those account numbers that have changed? 

Anyway, I worked it out. 

 

BenBennett321_0-1706632302805.png

When an item is modified on my sharepoint list it checks that the value in the specified column matches already on the sharepoint list, (using the filter array) .

 

The Select part just gets the certain columns from the list to identify the duplicates, turns it into a Html table which is put into the email.  The Compose action is just to add some CSS to make the html table more attractive.

 

Thank you to myself.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (893)