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

# Field map editor

> Give users a guided way to choose which tables and fields sync for a linked connector.

The field map editor gives tenants a in-widget way to decide what data should sync from a linked connector. Tenants can open **Edit field map**, review the available catalog, and save their table and field choices back to the connector.

<Frame caption="Tenants can edit the field map directly from the connector manager">
  <video src="https://mintcdn.com/hotglue/9V3tRnrdVCWNCl-f/widget-v3/images/editfieldmap.mov?fit=max&auto=format&n=9V3tRnrdVCWNCl-f&q=85&s=37b75e8c8b440579bf58e739a6212d5b" controls autoPlay loop muted data-path="widget-v3/images/editfieldmap.mov" />
</Frame>

Tenants can:

* choose which tables should be synced
* open any table to pick individual fields
* search across tables and fields
* refresh the catalog when the connector schema changes
* save the updated field map without leaving the widget flow

## Selecting data

Users start by selecting tables to sync. They can search tables, select or deselect them, and open a table to pick specific fields. Selected and available fields appear in separate lists.

Required fields cannot be removed. If all fields in a table are selected, the field map stores it as a wildcard for efficiency, though the UI still lists the fields.

## Catalog refresh

When opened, the editor checks if catalog discovery is still running and polls until it finishes. Users can also refresh the catalog manually. While refreshing, editing and saving are disabled. Errors are shown in the UI with an option to retry.

## Save behavior

Saving updates the connector’s field map, shows a success message, fires `onFieldMapSave` if set, and returns to the manager. The widget then refetches the connector, but a refetch error does not affect a successful save. Save errors are shown, and the editor stays open.

## Availability

To enable this in the hotglue dashboard, go to **Environment settings** → **Widget** and turn on **Allow tenants to edit field map**.

## Integration hook

Use `setListeners` to react after a field map has been saved successfully.

```javascript theme={null}
hotglue.setListeners({
  onFieldMapSave: ({ connectorId, connectorType, flowId, tenantId }) => {
    console.log("Field map saved:", {
      connectorId,
      connectorType,
      flowId,
      tenantId
    });
  }
});
```

### Event payload

* **connectorId**: `string`
* **connectorType**: `'connector' | 'source'`
* **flowId**: `string`
* **tenantId**: `string`

## Localization

The field map editor supports these localization entries:

* `ConnectorManager.fieldMap.title`
* `ConnectorManager.fieldMap.subtitle`
* `fieldMap.selectorTitle`
* `fieldMap.selectorDescription`

```tsx theme={null}
{
  ConnectorManager: {
    fieldMap: {
      title?: string
      subtitle?: string
    }
  },
  fieldMap: {
    selectorTitle?: string
    selectorDescription?: string
  }
}
```

### Example

```tsx theme={null}
hotglue.setLocalization({
  ConnectorManager: {
    fieldMap: {
      title: "Edit field map",
      subtitle: "Choose which tables and fields should sync."
    }
  },
  fieldMap: {
    selectorTitle: "Select tables",
    selectorDescription: "Choose the tables and fields to include in syncs."
  }
});
```
