---
url: /process-functions/table-fieldexists.md
description: Checks whether a table in the model has a field.
---

# table.fieldExists

Checks whether one of the model's [tables](/technical/tables) has a field.

::: tip
For more control, such as other column types, indexes or keys, manage tables with SQL instead. Run `CREATE`, `ALTER` and `DROP TABLE` statements with [DatasourceClient](/process-functions/datasourceclient)'s `execute`.
:::

```js
table.fieldExists(tableName, fieldName)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `tableName` | `string` | The table's name or id. |
| `fieldName` | `string` | The field's name. |

## Returns

`true` if the field exists. `false` if it doesn't, or the table can't be found.

## Examples

```js
const exists = table.fieldExists("users", "password");
```

## Related

* [table.fieldAdd](/process-functions/table-fieldadd)
* [table.fields](/process-functions/table-fields)
