Problem / Solution: Approval block fails with error: Creating Approvals failed for wf Instance. An item with the same key has already been added.

Version 1

    Environment:

    Any version of ISM

     

    Requires Access To:

    Admin role

     

    Error message:

    Creating approvals failed for wf instance Id:{ID}, Blk Name:vote0007, Blk Title:Spec Approval Decision Tree, Blk Id:{ID}

    Exception Details:

    Message: An item with the same key has already been added.,

    Stacktrace:

    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)

    at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)

    at FrontRange.Workflow.Block.Vote0007.Vote0007.GetEmployee(String empFieldName, String empFieldValue)

    at FrontRange.Workflow.Block.Vote0007.Vote0007.GetApprovers()

    at FrontRange.Workflow.Block.Vote0007.Vote0007.CreateApprovals()

    at FrontRange.Workflow.Block.Vote0007.Vote0007.InvokeBlock(BlockExecutionInput input, BlockExecutionOutput& output)

     

    Problem:

    Approval block fails with error: Creating Approvals failed for wf Instance. An item with the same key has already been added.

     

    Cause:

    Multiple records are pulled back when referencing the Vote owner by email address.

     

    Solution / Workaround:

    Check the Email address referenced by the fields used to map the Approver in the Approval block against the Contact Store.  If more than one record is returned this error can occur.  Please ensure each contact has a unique Email address.