Skip to main content
Hello Community:

 

I'm stumped on a flow error.  I'm attempting to take the Campaign Members of a Campaign and add them to a newly created campaign.  The basics of the flow are as follows...

 

I call a "Get Records" to retrieve all Campaign Member Records associated with the campaign that started the flow. These Campaign Member records contain both Leads and Contacts. I then loop through the retrieved Campaign Members records. There is a Decision element that compares whether the field "LeadorContactID" contains a Lead or a Contact. If a Contact then the Assignment elements assigned the LeadorContactId to the CM ContactID and if a Lead then a separate assignment to Lead takes place. A collection variable is updated and a fast create on Campaign Member takes place after the loop.

 

Here's the issue: Everything works fine when the Get CM Records only returns Contacts. The problem occurs as soon as it loops over a Lead. The decision logic works and the lead assignment occurs, however when it's time to create the records, there are duplicates. The last retrieved contact is added again with the Lead thus creating a duplicate Campaign Member. I can't seem to figure out what is going wrong.

 

Here are the errors:

 

This error occurred when the flow tried to create records: DUPLICATE_VALUE: Attempted to add an entity '0036A00000kzjvv' to a campaign '7013u000000Mjhh' more than once...

 

Variable Values

 

[CampaignId=7013u000000MjhhAAC,Status=Invited,ContactId=0033u000018EKfmAAG]

 

[CampaignId=7013u000000MjhhAAC,Status=Invited,ContactId=0036A00000iCFijQAG]

 

[CampaignId=7013u000000MjhhAAC,Status=Invited,ContactId=0036A00000k3EkMQAU]

 

[CampaignId=7013u000000MjhhAAC,Status=Invited,ContactId=0036A00000kwumIQAQ]

 

[CampaignId=7013u000000MjhhAAC,Status=Invited,ContactId=0036A00000kzjvvQAA]

 

[CampaignId=7013u000000MjhhAAC,Status=Invited,ContactId=0036A00000kzjvvQAA,LeadId=00Q3u000014A0qbEAC]

 

[CampaignId=7013u000000MjhhAAC,Status=Invited,ContactId=0036A00000kzjvvQAA,LeadId=00Q3u000014A0qqEAC]

 

Result

 

Failed to create records.

 

Here is a pic of the part of the flow that contains the issue

 

Flow Creating Duplicate Campaign Members
4 answers
  1. Dec 31, 2019, 3:54 PM
    UPDATE: I was able to solve the initial issue of adding both the LeadID and ContactID at the same time.  I needed a separate variable for both conditions. 
0/9000