# Populate fields with logged in data clerks details via program rules

**URL:** <https://community.dhis2.org/t/populate-fields-with-logged-in-data-clerks-details-via-program-rules/39938>\
**Category:** App Development\
**Tags:** tracker, web-app\
**Created:** [29 July 2020 14:40 UTC](https://community.dhis2.org/t/populate-fields-with-logged-in-data-clerks-details-via-program-rules/39938 "2020-07-29T14:40:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drlappies](https://dhis2.b-cdn.net/letter_avatar_proxy/v4/letter/d/73ab20/32.png) [@drlappies](https://community.dhis2.org/u/drlappies)\
**Post date:** [29 July 2020 14:40 UTC](https://community.dhis2.org/t/populate-fields-with-logged-in-data-clerks-details-via-program-rules/39938/1 "2020-07-29T14:40:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![brian](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/brian/32/48251_2.png) [@brian](https://community.dhis2.org/u/brian)\
**Post date:** [5 August 2020 14:09 UTC](https://community.dhis2.org/t/populate-fields-with-logged-in-data-clerks-details-via-program-rules/39938/2 "2020-08-05T14:09:49Z")

</div>

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: [[DHIS2-5883] - Jira](https://jira.dhis2.org/browse/DHIS2-5883)

and

> [@TEA Value type - Username: Shows all users in system and does not auto-complete the username](https://community.dhis2.org/t/tea-value-type-username-shows-all-users-in-system-and-does-not-auto-complete-the-username/34897):
>
> Hi All I am currently using the Value type: Username in a tracker program (with registration). The description in the documentation (User Guide v2.30) mentions that the currently logged in user’s username will be automatically filled in this field (which would be ideal for our use). However, this is not the case. The TEA is currently enabling the end user to select a username from a list of ALL users in the system (including those that are not attributed any rights or access to this specific p…

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!)

Brian

---

<div class="post-metadata">

**Author:** ![WaluQ](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/waluq/32/118_2.png) [@WaluQ](https://community.dhis2.org/u/WaluQ)\
**Post date:** [26 August 2022 10:35 UTC](https://community.dhis2.org/t/populate-fields-with-logged-in-data-clerks-details-via-program-rules/39938/3 "2022-08-26T10:35:36Z")

</div>

Has there been any action taken to implement this?
