function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jon SheaJon Shea 

Resolving duplicate values in Process Builder

I've been running into some issues with Process Builder and how it handles duplicate values. To be clear - this is not a question about duplicate contact records. 

I have a Flow and a Process set up to automatically add users to a Case team - such as the case creator.  Separately in Case Assignment rules, I have a default case team established for a specific Record Type. 

The error I am getting is when a user who is on the default case team, also creates a case. This leads to a duplicate value error in the case team (assiged first in the assignment rule / default case team, and then attempts to update again with the Flow and Process builder) and the flow will not execute and no record is created. 

Has anyone dealt with something similar ? Is there a way to prevent the whole process from failing (and thus a record not being created). It seems like there should be a way to handle the error a little less disruptively. 
 
Jason Kuzmak 12Jason Kuzmak 12
I have, but I have no way around this without apex. My example: I have custom user fields that count the number of opportunities won or lost for that user, per machine type sold. The count in these fields are incremented through formulas in Process Builder. When I implemented these fields, I wanted to mass update my opportunities to reflect the correct machine, which pushes Process Builder to update my user fields. Of course, many of the user ids it has to reference are duplicates.

I can get around this by managing this process in Apex, but I'm anticipating this will be the only time I'll ever have to bulk update these fields, so instead I'm updating them through data loader with the batch size set to 1, and using CSVs with only about 500 records per sheet per hour to stay below my limits.

If I'm understanding what I read correctly about limits, "Total number of flow interviews that are resumed or groups of scheduled actions that are executed per hour" is 1000, so this is something I have to worry about with the way I'm doing it.