Non-unique attribute value

Hi team,

Who knows if the sub-unique field of tracked entity attribute that sets the unique value to be unique in each org unit, really works? It is supposed to allow an same ID to exist in different org units. :
Screenshot from 2023-03-31 01-29-07

Although I set this TE attribute to be unique in org units, I get the error: “Non-unique attribute value” when doing a bulk upload (via API). However IDs are unique across each organisation unit. I have to turn off unique feature to have successful upload.

How is this feature supposed to work?

1 Like

Hi @Quoda

Thanks for the post! Your description is correct, the docs says: “The values of the tracked entity attribute must not duplicate in the same organisation unit,” so it’d help to check and try to reproduce this issue.

Please, what version of dhis2 are you using? Does this issue happen only when doing a bulk upload via API or even when directly using the UI? It could help if you add steps to reproduce the issue in one of the instances!

@Quoda I’m not able to reproduce this on the instance when using the UI (Tracker Capture app). Please share more info about steps to reproduce and the instance version. :+1:

:slight_smile: Thanks!

Hi @Gassim

Thanks for the response.

With that setting, I am able to create another TEI with same ID in another organisation unit through the UI (then it works as expected), you’re therefore right that this is not reproducible on the UI.

However, with this setting bulk import through the API will throw the “Non-unique value” error. This is something you can reproduce. I had to turn of the setting (disable unique) to be able to carry out the bulk import via API.

NB: Version=2.37