---
url: /process-functions/script-getusername.md
description: Returns the name of the user running the process.
---

# script.getUserName

Returns the name of the user running the process, or of another user.

```js
script.getUserName(userId)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `userId` | `number` | Optional. A user's id, to get that user's name instead. |

## Returns

The user's name.

## Examples

```js
const userName = script.getUserName();
```

## Related

* [script.getUserId](/process-functions/script-getuserid)
* [script.getUserEmail](/process-functions/script-getuseremail)
