[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/admin](../../README) / [index](../README) / guessColumnMapping

# Function: guessColumnMapping()

> **guessColumnMapping**(`headers`, `candidates`): `Record`\<`number`, `string`\>

Defined in: [admin/src/actions/csv.ts:106](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/actions/csv.ts#L106)

Pair a CSV's header cells with resource fields.

Matching is forgiving about the ways a label and a key differ in practice —
case, spaces, underscores, hyphens — so a file exported from the panel
re-imports without the user mapping a single column by hand.

## Parameters

### headers

`string`[]

### candidates

`object`[]

## Returns

`Record`\<`number`, `string`\>
