Assign Primary Key Exception - "These columns don't currently have unique values"

I have a flow wherein I am building two data tables in UiPath by way of the Build Data Table activity. After building them, I am assigning the common column as primary key in order to merge them. This works for one of the data tables, but for the other I keep receiving this error:

I removed this step and saved the data table directly to CSV, and in doing so I was able to confirm that value in every row for this column is a unique value. The assign appears to be set up correctly, as it does work for the other data table.

datatable.PrimaryKey = new DataColumn() { datatable.Columns(0) }

Any idea what I need to tweak in order to get this to work?


May not help much , but did you check nulls and leading spaces in columns?

1 Like

Yep, no null values and no leading or trailing spaces in the headers or the designated primary key column.

I have the same problem, but only 1 table with two columns.
When I assign the other column as key, it says it has null values, which it is not true, according to the debugger, as the program iteratively adds selector strings to the datatable. :expressionless:

Hey ,

What could be the solution for this? , I also have the same error.

I created new sheet and pasted all the values from old sheet, it work for me. Old sheet might have null values.