# defineCustomField

> API reference for defineCustomField: parameters, properties, and return types.

Defines a custom field on a native or custom object.

```ts
import { defineCustomField } from '@rippling/rippling-sdk';
```

## Properties

| Property | Required | Type | Description |
| --- | --- | --- | --- |
| `apiName` | Required | `` `${string}__cfv2` `` | — |
| `dataType` | Required | `[CustomFieldDataType](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/CustomFieldDataType-6222c021)` | — |
| `modelName` | Required | `string` | — |
| `modelRqlName` | Required | `string` | — |
| `name` | Required | `string` | — |
| `section` | Required | `[DefinedCustomFieldSection](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/DefinedCustomFieldSection-d53cb732)<NoInfer<TModel>>` | — |
| `fieldWriteAccess` | Required in some variants | `"NO_ACCESS" \| null \| "ADMIN_ACCESS" \| "ADMIN_AND_EMPLOYEE_ACCESS" \| "EMPLOYEE_ACCESS"` | — |
| `rqlDefinitionFormula` | Required in some variants | `string \| null` | — |
| `applicableGroup` | Optional | `null \| [GroupConfig](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/GroupConfig-3b3b684c) \| Record<string, unknown> & { type: typeof COMPONENT_TYPE; name: string; }` | — |
| `applicableGroupId` | Optional | `null \| string` | — |
| `collectDuring` | Optional | `null \| "ONBOARDING" \| "NONE" \| "HIRING" \| "TERMINATING"` | — |
| `defaultValue` | Optional | `null \| { value: string; rqlDefinitionFormula?: never; } \| { value?: never; rqlDefinitionFormula: string; }` | — |
| `description` | Optional | `null \| string` | — |
| `displayOrder` | Optional | `null \| number` | — |
| `fieldPermissionClassification` | Optional | `null \| "BASIC_PERSONAL_INFO" \| "PERSONAL_INFO" \| "SENSITIVE_PERSONAL_INFO" \| "BASIC_EMPLOYMENT_INFO" \| "EMPLOYMENT_INFO" \| "SENSITIVE_EMPLOYMENT_INFO"` | — |
| `fieldReadAccess` | Optional | `null \| "ALL_ACCESS" \| "ADMIN_ACCESS" \| "ADMIN_AND_EMPLOYEE_ACCESS"` | — |
| `required` | Optional | `null \| boolean` | — |
| `tip` | Optional | `null \| string` | — |

Requirements marked “in some variants” depend on the selected union member.

[Complete options type](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/DefineCustomFieldProps-152c99fe)

TypeScript signature

```ts
defineCustomField<const TModel extends string>(props: DefineCustomFieldProps<TModel>): CustomField<TModel>;
```

## Returns

```
CustomField<TModel>
```

## Availability

| Capability | Support |
| --- | --- |
| Pull into a project | Supported |
| Runtime operations | Not available for this helper |

Source: https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/defineCustomField

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
