# Get the logged in user in a task form

**URL:** <https://forum.camunda.io/t/get-the-logged-in-user-in-a-task-form/59752>\
**Category:** Camunda 7 Topics\
**Created:** [February 17, 2025, 8:00pm UTC](https://forum.camunda.io/t/get-the-logged-in-user-in-a-task-form/59752 "2025-02-17T20:00:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fml2](https://forum.camunda.io/user_avatar/forum.camunda.io/fml2/32/6280_2.png) [@fml2](https://forum.camunda.io/u/fml2)\
**Post date:** [February 17, 2025, 8:00pm UTC](https://forum.camunda.io/t/get-the-logged-in-user-in-a-task-form/59752/1 "2025-02-17T20:00:25Z")

</div>

Hello,

in the form that is used to display a user task in my process, I’d like to show the information about the current user, i.e. the one that is currently logged in to the cockpit. This information should be available IMO since the cockpit somehow manages to display it in the top right area. However, I still have not managed to do it. The “currentUser()” expression doesn’t seem to deliver the desired info (it delivers NULL).

Could anybody please show an example of how to do this?

Thank you!

---

<div class="post-metadata">

**Author:** ![hassang](https://forum.camunda.io/user_avatar/forum.camunda.io/hassang/32/16498_2.png) [@hassang](https://forum.camunda.io/u/hassang)\
**Post date:** [February 18, 2025, 7:24am UTC](https://forum.camunda.io/t/get-the-logged-in-user-in-a-task-form/59752/2 "2025-02-18T07:24:45Z")

</div>

Hi @fml2

The following post might be of help to you

> [@Get current user email](https://forum.camunda.io/t/get-current-user-email/27133/2):
>
> Hi @kok, Try below snip of code. \<script cam-script type="text/form-script"\> inject(['$rootScope', '$scope', 'camAPI', function($rootScope, $scope, camAPI) { var userName = $rootScope.authentication.name; var User = camAPI.resource('user'); User.profile({id: userName}, function(err, data) { if (!err) { //alert('Data: ' + JSON.stringify(data)); alert('Email: ' + data.email); } }); }]); \</script\>

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [May 19, 2025, 7:25am UTC](https://forum.camunda.io/t/get-the-logged-in-user-in-a-task-form/59752/3 "2025-05-19T07:25:23Z")

</div>

Closed on May 19, 2025, 7:25am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
