Populate fields with logged in data clerks details via program rules

Is there any way we can get the logged in persons username/name via a program rule and assign them to a field within a program stage?

1 Like

Hi Lappies,

As of right now there is no program rule variable for current_user to autofill a data element via program rules.

There has been some discussion about that use case, notably in comments here: Log in - DHIS 2 JIRA


Possible workarounds:
The data element value type USERNAME only shows a list of all current users in the system–the user could in theory select their own from the list, although thats not the functionality you’re looking for.
It would also be possible to routinely populate this data element through api/event’s “storedBy” field, via external script, although that’s not very practical if a single program rule would do.

Maybe @Markus and the tracker team could share more on where this is in the roadmap (I am following this closely myself!)


1 Like

Has there been any action taken to implement this?