Using Flow to add Contacts to Campaign - Receiving a Duplicate Value error in Flow when no duplicate value exists - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Bo MontierBo Montier 

Using Flow to add Contacts to Campaign - Receiving a Duplicate Value error in Flow when no duplicate value exists

I am using a flow (started by a process builder) to create a Campaign Member record on a designated Campaign.

The Process Builder identifies the correct Contacts to be entered into the Campaign after they are uploaded via our nightly Data Loader Integration run. From there they start the flow interview and send over the appropriate variable.

The flow gathers appropriate data from related records, tests to see if the contact is already a campaign member, and then creates a Campaign Member record where appropriate.

When I debug the flow with an individual record variable, the process works without issue. When I test it with the nightly run, however, I receive Duplicate Value errors despite the fact that the Campaign currently has no Campaign Members and the fact that I have a Duplicate check IN the flow itself. 

Here is the error:Error Occurred: This error occurred when the flow tried to create records: DUPLICATE_VALUE: Attempted to add an entity '0032S00002B80wF' to a campaign '7012S000000qr97' more than once.. You can look up ExceptionCode values in the SOAP API Developer Guide (https://urldefense.proofpoint.com/v2/url?u=https-3A__developer.salesforce.com_docs_atlas.en-2Dus.api.meta_api_sforce-5Fapi-5Fcalls-5Fconcepts-5Fcore-5Fdata-5Fobjects.htm-23&d=DwMFaQ&c=eEG3Z7MkO11Bd4IC-7maQQdCp9liZSB0EpHm0qcJKwI&r=S7MjEmKmz_FYtelui5V8bzsVkm39eHOkml_zgVXiyEc&m=lIosfv0BLgmOCtBAudN1hWZpmQO98ps2FCEzWcfIhfs&s=MoW_OQD0FI199oNk_nKXgGLFIGcCFPMqcqNrhvHfKSg&e=" style="color:blue; text-decoration:underline).---This error occurred when the flow tried to create records: DUPLICATE_VALUE: Attempted to add an entity '0032S00002B84ND' to a campaign '7012S000000qr97' more than once.. You can look up ExceptionCode values in the SOAP API Developer Guide (https://urldefense.proofpoint.com/v2/url?u=https-3A__developer.salesforce.com_docs_atlas.en-2Dus.api.meta_api_sforce-5Fapi-5Fcalls-5Fconcepts-5Fcore-5Fdata-5Fobjects.htm-23&d=DwMFaQ&c=eEG3Z7MkO11Bd4IC-7maQQdCp9liZSB0EpHm0qcJKwI&r=S7MjEmKmz_FYtelui5V8bzsVkm39eHOkml_zgVXiyEc&m=lIosfv0BLgmOCtBAudN1hWZpmQO98ps2FCEzWcfIhfs&s=MoW_OQD0FI199oNk_nKXgGLFIGcCFPMqcqNrhvHfKSg&e=" style="color:blue; text-decoration:underline).
Flow OverviewPull Financial Account, Primary Owner, Opened By User IDs 1Pull Financial Account, Primary Owner, Opened By User IDs 2Test for DuplicatesTest for Duplicates 2

More Screenshots in Comments/Answers as I've run out of space
 
Bo MontierBo Montier
Duplicate Found DecisionCampaign Member Creation 1Campaign Member Creation 2Campaign Member Creation 3