Does event has UID?

can we set uid to an event?

@linxd,
Interesting question! It would be very helpful to know more about your use case; however, here’s some helpful info! (:

Every Identifiable Object in DHIS2 has an idScheme which can be UID (default), CODE, NAME, or ATTRIBUTE:ID. The UID can be overridden by either of the later three idSchemes.
Scheme Values

One way to know if an object is identifiable we can use the API Schemas in the following way:
[yourInstanceURL]/api/schemas?fields=displayName,identifiableObject&filter=singular:eq:metadataSingularName (such as programStage)

Hope this helps! Thanks! (:

Thanks,I mean to add another event user specified id not only 11 chars.

@linxd You’re welcome!
Please explain more about your use case and what you are trying to achieve it might be easier to help! Thank you! (:

for example, when I want to update an event, I mustbe to query the event’s id to update at first,which is a cost time action for large number of events.

I understand so it seems you want to update the events and create a new value for the id all at once instead of querying for the id then updating. Because I can’t see the actual query/script it’s difficult to find more info or attempt to test this so I don’t know the possibility of doing this.

It might be helpful if you share the query so we can share it with other community members and DHIS2 core team experts. If you are developing an app please let me know so I can move this to the #development category.

Thanks! @linxd

as of the event id is fixed to 11 chars. but usually,the user code of event is random length. so hope to add an user code for event.

1 Like

Maybe you’d be interested in checking out @josephatjulius solution to a similar issue: Issue creating a tracked entity instance with a generated UID via API - #6 by josephatjulius