# DataConnections.refresh Method

> DataConnections.refresh method in the Node.js TypeScript API: Fetches and validates a complete snapshot before writing. Latest refresh wins.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Sheet Control > API Reference > TypeScript API > Node.js Server > DataConnections > DataConnections.refresh Method
- **533 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dataconnections/refresh-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dataconnections/refresh-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dataconnections/refresh-method/llms-full.txt

---

Fetches and validates a complete snapshot before writing. Latest refresh wins; failures preserve old data. Errors are returned to the host, which controls user-visible diagnostics. A timeout rejects with AbortError.

Owner: [DataConnections](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dataconnections/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

### Syntax

```typescript
refresh(id: string, options?: DataRefreshOptions): Promise<DataSnapshot>
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `id` | `string` | No | Stable identity in the owning document/collection. |
| `options` | `DataRefreshOptions \| undefined` | Yes | Supported settings for this operation; omitted settings retain documented defaults. |

### Return Value

`Promise<DataSnapshot>`.

### Examples

Pass an existing DataConnections from the owning document. Related handles and input bytes must belong to the intended document and application; the function applies the operation and inspects its result.

```typescript
import type { DataConnections } from '@txtextcontrol/tx-sheet-control-server';

async function applyDataConnectionsRefresh(dataConnections: DataConnections) {
    const result = await dataConnections['refresh']('revenue');
    console.log(result);
}
```

### Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

### See Also

- [DataConnections Class](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dataconnections/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)
- [DataSnapshot Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/datasnapshot/llms-full.txt)
- [DataRefreshOptions Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/datarefreshoptions/llms-full.txt)

---

## Nearby

- **Previous:** [DataConnections.onChange Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dataconnections/onchange-method/llms-full.txt)
- **Next:** [DataConnections.refreshAll Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dataconnections/refreshall-method/llms-full.txt)
