---
url: "https://vueda.dev/v3/reference/api/js/utils/fieldMappings.md"
title: "utils/fieldMappings"
---

# utils/fieldMappings

## Overview

Default mappings from DRF serializer field types to Vue field components and widget components.

## Properties

### choiceFieldMappings {#choiceFieldMappings}

Type: `object`

Source: `client/lib/utils/fieldMappings.js:337`

### defaultFieldMappings {#defaultFieldMappings}

Type: `object`

Source: `client/lib/utils/fieldMappings.js:31`

### filterFieldMapping {#filterFieldMapping}

Field-to-component mappings for filter form fields, keyed by the filter type the server
reports as a filter's `typeFilter`. Every type here also has value handling in
FilterFieldMappings. `ChoiceField`, `TypedChoiceField`, and `MultipleChoiceField` render
the choices listed in the filter metadata. The `ModelChoice*` and `AllValues*` types render
`WidgetModel`, which fetches their choices from the filter choices endpoint.

Type: `object`

Source: `client/lib/utils/fieldMappings.js:624`

### FilterFieldMappings {#FilterFieldMappings}

Per-filter-type value configuration: the empty/initial value a filter field
starts from, whether it is a range (suffix pair) or an array filter, and how
the list request encodes an array value. The live filter form
(`useFilterField`) and URL→filter restoration (`buildFilterFromQuery`) both
read it, so query values coerce the same way in each. filterFieldMapping holds the components for the same types. A
custom filter type registers its entry here through
mergeFilterFieldMapping, alongside its components.

Type: `object`

Source: `client/lib/utils/fieldMappings.js:815`

### manyFieldMappings {#manyFieldMappings}

Type: `object`

Source: `client/lib/utils/fieldMappings.js:438`

## Methods

- [mergeDefaultFieldMappings](/v3/reference/api/js/utils/fieldMappings/functions/mergeDefaultFieldMappings.md) - Merge custom field mappings into the default set used for forms.
- [mergeFilterFieldMapping](/v3/reference/api/js/utils/fieldMappings/functions/mergeFilterFieldMapping.md) - Register custom filter types, or adjust existing ones, for filter forms.
- [mergeManyFieldMappings](/v3/reference/api/js/utils/fieldMappings/functions/mergeManyFieldMappings.md) - Merge custom field mappings used for many-to-many selections.

## Types

### [FieldMappingEntry](/v3/reference/api/js/utils/fieldMappings/types/FieldMappingEntry.md)

### [FilterValueMapping](/v3/reference/api/js/utils/fieldMappings/types/FilterValueMapping.md)

### [FilterFieldMappingInput](/v3/reference/api/js/utils/fieldMappings/types/FilterFieldMappingInput.md)

`FilterFieldMappingInput = FieldMappingEntry & FilterValueMapping`

## Source

`client/lib/utils/fieldMappings.js:1`
