> For the complete documentation index, see [llms.txt](https://deskpro.gitbook.io/apps-developer-guide-old/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://deskpro.gitbook.io/apps-developer-guide-old/application-context/access-custom-fields.md).

# Access Custom Fields

The Custom Fields feature give you another way of storing application data which is associated with the application context's Deskpro Object.

If you are not yet familiar with the concept of Custom Fields in Deskpro, head over to the official documentation: <https://support.deskpro.com/en/guides/admin-guide/ticket-fields-2/custom-fields>

You access Custom Fields through a [CustomFieldsClient](https://deskpro.github.io/apps-sdk-core/reference/CustomFieldsClient.html), which is made available via the [customFields](https://deskpro.github.io/apps-sdk-core/reference/Context.html) property of the application context:

```javascript
    const { customFields } = this.props.dpapp.context;
    customFields.getField('myFieldId').then(value => console.log(value));
```

For setting the value of a field:

```javascript
    const { customFields } = this.props.dpapp.context;
    customFields.setField('myFieldId', myValue).then(response => console.log(response.body));
```

The methods above allow you to retrieve the value of any custom field by its id. For custom fields which are created by your application and which are referred to by their alias, the custom fields client offers a set of similar methods.

If your application is adding new custom fields and you need to access them use the following method for reading:

```javascript
    const { customFields } = this.props.dpapp.context;
    customFields.getAppField('myAlias').then(value => console.log(value));
```

For setting the value of a field:

```javascript
    const { customFields } = this.props.dpapp.context;
    customFields.setAppField('myAlias', myValue).then(response => console.log(response.body));
```
