# SheetCell

### How to use SheetCell

{% code overflow="wrap" %}

```tsx
import { SheetCell } from "@rowsncolumns/spreadsheet-state"

const sheetCell = new SheetCell()

// Extend if necessary from existing cellData
const existingCellData = {}
sheetCell.assign(sheetId, { rowIndex, columnIndex }, existingCellData) 

// Set user entered value
sheetCell.setUserEnteredValue("$20")

// Get cell data
const cellData = sheetCell.getCellData()
```

{% endcode %}

CellData is the cell representation used in Spreadsheet 2. Short-form keys (`ue` / `ev` / `uf` / `fv`) are preferred for new writes — see [Cell Data](/configuration/api/cell-data.md) for the full type. The same short-form convention applies inside `ExtendedValue`: `nv` (number), `sv` (string), `bv` (bool), `fv` (formula), `ev` (error).

```json
{
    "ue": {
        "sv": "20"
    },
    "ev": {
        "nv": 20
    },
    "fv": "$20",
    "uf": {
        "numberFormat": {
            "type": "CURRENCY",
            "pattern": "\"$\"#,##0"
        }
    }
}
```

{% hint style="info" %}
`effectiveFormat` / `ef` are no longer written on `CellData`. The renderer derives the effective format on the fly from `uf`, the cell value, and (for formula cells) precedent formats. Older saved data with `effectiveFormat` still loads.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rowsncolumns.app/configuration/api/sheetcell.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
