---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - en/function-ref/USER_INFO
  - ru/function-ref/USER_INFO
  - href: en/function-ref/USER_INFO.md
    type: text/markdown
    title: Markdown version
csp:
  - script-src:
      - https://mc.yandex.ru
    img-src:
      - https://mc.yandex.ru
    connect-src:
      - https://mc.yandex.ru
      - wss://mc.yandex.ru
    child-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-src:
      - 'blob:'
      - https://mc.yandex.ru
    frame-ancestors:
      - 'blob:'
      - https://mc.yandex.ru
canonical: en/function-ref/USER_INFO.html
editable: false
vcsPath: en/function-ref/USER_INFO.md
---

# USER_INFO



#### Syntax {#syntax}


```
USER_INFO( user_id, user_info_type )
```

#### Description {#description}
Returns the marked up text by `user_id` to display username or email depending on the `user_info_type` value:

* `email`: Returns email.
* `name`: Returns name.

If the user has not been found, the function will return the original string from the source.

**Argument types:**
- `user_id` — `String`
- `user_info_type` — `String`


**Return type**: `Markup`

#### Examples {#examples}

```
USER_INFO('b1ggmp8es27t********', 'name') = 'test_user'
```

```
USER_INFO([UserId], 'email') = 'test_user@example.com'
```


#### Data source support {#data-source-support}

`ClickHouse 21.8`, `Files`, `Google Sheets`, `Microsoft SQL Server 2017 (14.0)`, `MySQL 5.7`, `Oracle Database 12c (12.1)`, `PostgreSQL 9.3`, `Trino`, `Yandex Documents`, `YDB`.
