> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# DEPTNAME

> The DEPTNAME function retrieves the department information of a specified user based on their user ID. It is supported in YiDA forms and workflow design. Combine this function with LOGINUSERWORKNO() to retrieve the department name of the currently signed-in user.

The **DEPTNAME** function retrieves the department information of a specified user based on their user ID.

## Supported Scenarios

The DEPTNAME function is supported in the following YiDA scenarios:

* Form (main table fields)
* Form (business association rules)
* Form (validation)
* Workflow design (validation rules)
* Workflow design (associated actions)

## Format

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
DEPTNAME(userid)
```

## Attribute Description

| **Attribute** | **Required** | **Description**                                                                                                                                                                                                                                 |
| ------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| userId        | No           | The user ID of the user to query.<br />Retrieve this user ID using the member component. To retrieve the department of the currently signed-in user, use the `LOGINUSERWORKNO()` function directly.<br />Example: `DEPTNAME(LOGINUSERWORKNO())` |

## Return Value

| **Return type** | **Description**                                          |
| --------------- | -------------------------------------------------------- |
| Text            | The department name of the currently signed-in employee. |

## Example

As shown in the figure below, use the `DEPTNAME()` and `LOGINUSERWORKNO()` functions to retrieve the department name of the currently signed-in employee.
