I am working on a tracker program where I need to auto-fill the username and designation of the logged-in user in a form. I found that the value type “Username” can be used for fetching usernames, but I am unsure how to retrieve and display the user’s designation dynamically.
I have a few questions regarding this:
How can I auto-fill the logged-in user’s username in a form field?
Is there a way to retrieve and display the user’s designation dynamically?
Can program rules or scripts be used to achieve this in both the web and Android versions of DHIS2?
Are there any limitations or workarounds for this functionality?
I would appreciate any guidance or examples on implementing this feature.
Thank you for your response. Users designation means users role .i have a field of users name and user role in form .how to assign the value of users and users role dynamically!
Thanks for your patience. I’m sorry, I don’t think there’s an out of the box solution to auto-fill a user’s role but you might be able to use program rule with some alterations. For example, if you suffix-prefix usernames with a code that refers to the role, you will be able to use program rule that will autofill a data element with the role.