---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [config](../index.md) / locateConfigField

# Function: locateConfigField()

> **locateConfigField**(`config`, `field`): [`ConfigFieldLocation`](../interfaces/ConfigFieldLocation.md)

Defined in: [packages/b2c-tooling-sdk/src/config/config-write.ts:237](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/bceb8da43dd8bc63d57932bbd905d36a1b40c949/packages/b2c-tooling-sdk/src/config/config-write.ts#L237)

Locate a field in a resolved configuration: which source supplies it and
which source a write should update.

The target is, in order: the source supplying the field; the source
supplying the other half of its credential pair; or, for a field nothing
sets, the source that supplied the instance itself (its `instanceName`, else
its `hostname`). A derived value (a sandbox hostname worked out from its
tenant ID) counts as supplied by the source of the field it came from. Every
rule uses only [ConfigSourceInfo](../interfaces/ConfigSourceInfo.md) and the optional write methods, so
plugin sources take part the same way dw.json does.

## Parameters

### config

[`ResolvedB2CConfig`](../interfaces/ResolvedB2CConfig.md)

### field

keyof [`NormalizedConfig`](../interfaces/NormalizedConfig.md)

## Returns

[`ConfigFieldLocation`](../interfaces/ConfigFieldLocation.md)
