# Supported data types for writing
This document introduces the data types supported by the V2 version interface for writing.

## Version description
The V2 version interface refers to the interface whose HTTP URL contains the `v2` identifier. For example, the URL `/sheets/v2/spreadsheets/:spreadsheet_token/dimension_range` of [Add rows and columns](https://open.feishu.cn/document/ukTMukTMukTM/uUjMzUjL1IzM14SNyMTN) contains `v2`, indicating that this interface is a V2 version interface.

## String

```
"string"
```

## Number

```
123
```
## Date

1. Call the [Set cell style](https://open.feishu.cn/document/ukTMukTMukTM/ukjMzUjL5IzM14SOyMTN) interface to set the cell to date format, and the request body example is as follows:

```json
{
  "appendStyle": {
    "range": "vJFUIq!A1:A10",
    "style": {
      "formatter": "yyyy/MM/dd"
    }
  }
}
```

2. Call the [Write data to a single range](https://open.feishu.cn/document/ukTMukTMukTM/uAjMzUjLwIzM14CMyMTN) interface to write floating-point data, and the request body example is as follows:

```json
{
  "valueRanges": [
    {
      "range": "vJFUIq!A1:A10",
      "values": [
        [
          0
        ],
        [
          1
        ],
        [
          2
        ],
        [
          42101
        ]
      ]
    }
  ]
}
```

The integer part is the number of days since December 30, 1899; the decimal part is the proportion of the time within 24 hours. As shown in the above example, the date is displayed as shown in the figure below after writing:

![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/c598f964ca602b69dd3ed11bdfb40885_dZM5cD74rz.png?height=442&lazyload=true&maxWidth=200&width=219)

## Link

### Link without text

```
"http://www.dd.com"
```

### Link with text

```json
{
    "text": "text",
    "link": "http://www.dd.com",
    "type": "url"
}
```

## Email

```
"aaa@aa.com"
```

## @Person
When writing the @Person type, it will be processed asynchronously.

- @Person only supports @users within the same tenant.
- Using this type, a single request supports @up to 50 people simultaneously.

| Field               | Description                                                                                         |
|--------------------|----------------------------------------------------------------------------------------------|
| notify             | Whether to send Feishu messages, users without read permissions will not receive Feishu messages                                           |
| grantReadPermission| Whether to grant read permission to the user (this field is only supported in independent tables); only available when the document sharing permission is owned                 |
| textType           | Specifies the content passed in the `text` field, optional `email`, `openId`, `unionId`                                |
| text               | Information of the person to @, specified by `textType`                                                         |

```json
{
    "type": "mention",
    "text": "aaa@aa.com",
    "textType": "email",
    "notify": true,
    "grantReadPermission": true
}
```

## Formula

The text field is the corresponding formula, and cross-table reference formulas (IMPORTRANGE) are not supported for now.

```json
{
    "type": "formula",
    "text": "=A1"
}
```

## @Document

textType: fixed as fileToken

text: document token

objType: document type, optional sheet, doc, slide, Base, mindnote

```json
{
    "type": "mention",
    "textType": "fileToken",
    "text": "shtxxxx",
    "objType": "sheet"
}
```

## Dropdown list

Values are arrays, which can be filled with bool, string, number types. String-type data cannot contain ",". Before using, you need to use the [Set dropdown list](https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/datavalidation/set-dropdown) interface to set the dropdown list.

```json
{
    "type": "multipleValue",
    "values": [
        1,
        "test"
    ]
}
```

## Local style

### segmentStyle

bold: whether to bold

Italic: whether toitalic

strikeThrough: whether to strikethrough

underline: whether to underline

foreColor: font color, 16-bit RGB color

fontSize: font size, minimum size 9, maximum size 36

```json
{
    "bold": true,
    "italic": true,
    "strikeThrough": true,
    "underline": true,
    "foreColor": "#ff00ff",
    "fontSize": 30
}
```

### Write data with local style

#### String

```json
{
    "text": "string",
    "type": "text",
    "segmentStyle": {
        "bold": true,
        "italic": true,
        "strikeThrough": true,
        "underline": true,
        "foreColor": "#ff00ff",
        "fontSize": 20
    }
}
```

#### Number

Local style is not supported

#### Link

Supports writing different styles to different strings within the link. The foreColor field is not effective, fixed as blue; the underline field is not effective, fixed with underline;

```json
{
    "text": "text",
    "link": "http://www.dd.com",
    "type": "url",
    "texts": [
        {
            "text": "te",
            "segmentStyle": {
                "bold": true,
                "italic": true,
                "strikeThrough": true,
                "underline": true,
                "foreColor": "#ffffff",
                "fontSize": 20
            }
        },
        {
            "text": "xt",
            "segmentStyle": {
                "bold": true,
                "italic": false,
                "strikeThrough": true,
                "underline": true,
                "foreColor": "#ffffff",
                "fontSize": 10
            }
        }
    ]
}
```

#### Email

Supports writing different styles to different strings within the email. The foreColor field is not effective, fixed as blue; the underline field is not effective, fixed with underline;

```json
{
    "type": "url",
    "text": "aa@bytedance.com",
    "texts": [
        {
            "text": "aa",
            "segmentStyle": {
                "bold": true,
                "italic": true,
                "strikeThrough": true,
                "underline": true,
                "foreColor": "#ffffff",
                "fontSize": 20
            }
        },
        {
            "text": "@bytedance.com",
            "segmentStyle": {
                "bold": true,
                "italic": false,
                "strikeThrough": true,
                "underline": true,
                "foreColor": "#ffffff",
                "fontSize": 10
            }
        }
    ]
}
```

#### @Person
When writing the @Person type, it will be processed asynchronously.

- @Person only supports @users within the same tenant.
- Using this type, a single request supports @up to 50 people simultaneously.

| Field               | Description                                                                                         |
|--------------------|----------------------------------------------------------------------------------------------|
| notify             | Whether to send Feishu messages, users without read permissions will not receive Feishu messages                                           |
| grantReadPermission| Whether to grant read permission to the user (this field is only supported in independent tables); only available when the document sharing permission is owned                 |
| textType           | Specifies the content passed in the `text` field, optional `email`, `openId`, `unionId`                                |
| text               | Information of the person to @, specified by `textType`                                                         |
| segmentStyle       | Only supports setting local style for the whole; the foreColor field is not effective, fixed as blue                                                         |

```json
{
    "type": "mention",
    "text": "aaa@aa.com",
    "textType": "email",
    "notify": true,
    "grantReadPermission": true,
    "segmentStyle": {
        "bold": true,
        "italic": true,
        "strikeThrough": true,
        "underline": true,
        "foreColor": "#ff00ff",
        "fontSize": 30
    }
}
```

#### @Document

textType: fixed as fileToken

text: document token

objType: document type, optional sheet, doc, slide, Base, mindnote

The foreColor field is not effective, fixed as blue;

```json
{
    "type": "mention",
    "textType": "fileToken",
    "text": "shtxxxx",
    "objType": "sheet",
    "segmentStyle": {
        "bold": true,
        "italic": true,
        "strikeThrough": true,
        "underline": true,
        "foreColor": "#ff00ff",
        "fontSize": 30
    }
}
```

#### Dropdown list

Local style is not supported.