SUMMARY:
This knowledge base article explains why “This key is already associated with an element of this collection” error message appears when trying to save a group form in the Attribute Editor in Strategy Developer 9.4.x-10.x.
SYMPTOM:
When creating or editing an attribute with a grouped form mapped to a logical table, the following error message is displayed:
'This key is already associated with an element of this collection'.




The category selected for this form is already being used by another form in the current attribute. The only way to have multiple forms using the same form category is by creating a form group. Do you wish to create a form group?

Unexpected error This key is already associated with an element of this collection
CAUSE:
The column object created in the logical table was defined by typing the expression instead of mapping it to an existing column.
ACTION:
Define the column objects in the logical table by dragging existing columns from the physical source table from instead of using the 'Add' button as shown in the image below.

By following this procedure, users will notice that the attribute can be defined using only one expression because the columns are not duplicated. Attribute forms can be then grouped correctly as shown in the image below:

For more information about Logical Tables (Logical View), please refer to the following Technical Notes:
TN: 12000 (KB5300-800-0666): After creating a column in a logical table, automatic mapping does not occur for attributes referencing columns with the same name in Strategy 9.x
TN: 16858 (KB5700-8X-2746): How to create logical tables without creating duplicate columns objects in Strategy Desktop 9.