> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Replace map fields

> Replaces the complete map-field list.

`axiom.replaceMapFields` replaces the complete map-field list. Pass an empty `fieldNames` array to clear it; returns the resulting list.

```ts automations/axiom-replace-map-fields.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { axiom } from "automate.ax/axiom"

export default automation("Replace map fields", () => {
  onHttpRequest({ scope: "automation" })
  axiom.replaceMapFields({
    datasetName: "production",
    fieldNames: ["attributes", "resource"],
  })
})
```

## Inputs

`datasetName` selects the dataset by name or ID. `fieldNames` is the complete replacement list; it may be empty to remove every map-field designation.

## Output

Returns the resulting map-field names as `string[]`.

## Permission and failures

The API token needs the organization-level `datasets|update` capability and access to the target dataset. Axiom rejects missing datasets and fields that cannot be configured as maps. This operation replaces the entire list and is not retried automatically after an ambiguous provider response.
