# Location

A location picker for the order header. Shows locations available to the user's subsidiary, with smart defaults driven by order type — e.g. Pickup auto-selects the user's location, Delivery picks from session variable hierarchy.

The block tracks whether the user manually edited the selection so auto-defaults don't fight the user.

## Available in

* Order Form modules **only**

## When to use

* Multi-location operations where the order needs to be associated with a specific business location.
* Order Form pages for retail with multiple stores, or wholesale with multiple warehouses.
* Anywhere the order's location matters for stock, accounting, or fulfilment.

For single-location workflows, set the location once on the workflow and skip this block.

## Settings

| Setting       | Description                                                                                        |
| ------------- | -------------------------------------------------------------------------------------------------- |
| **Configure** | Opens the configuration modal — label, width, available locations, order-type-to-location mapping. |

The configuration modal supports:

* **Field Label** — display label.
* **Width** — input width in pixels. Default: 200.
* **Available Locations** — restrict the dropdown to specific locations. Empty = all locations available to the subsidiary.
* **Order Type Mapping** — per-order-type rules for auto-selecting a location:
  * *Pickup* → user's location.
  * *Delivery* → session variable priority: user > workflow > location > subsidiary.
  * Other types → custom mapping.

## How it works

1. Reads the active subsidiary from session storage.
2. Fetches the location list filtered by subsidiary.
3. Resolves the current location with this priority:
   * User edits (if the user changed the selection manually).
   * `transactionFields` (if loaded for an existing transaction).
   * Dynamic data (if pre-set elsewhere on the page).
   * Order-type mapping (auto-default).
   * Fallback to the first available location.
4. Auto-clears the selection if the order type changes and the new mapping is empty.
5. Tracks a `userEdited` flag — once the user manually picks, auto-defaults stop running.
6. Writes the selected value to `recordFields.location` via `setRecordField`.

{% hint style="info" %}
Use **Order Type Mapping** to make the workflow smart: a Pickup order auto-defaults to the cashier's home location; a Delivery order picks from a configured session variable. Less typing, fewer errors.
{% endhint %}

{% hint style="info" %}
When a workflow uses **live inventory sync**, changing the location here instantly updates the stock quantities displayed by the Product Locations block — no page reload needed.
{% endhint %}

## Examples

**Multi-store retail.** Location with Available Locations = all subsidiary locations, Order Type Mapping configured so each order type defaults sensibly.

**Restricted warehouse.** Location with Available Locations = `[Warehouse A, Warehouse B]`. Cashiers can only fulfil from those two warehouses.

**Pickup-defaulting POS.** Location with Order Type Mapping for Pickup = user's location. Cashier creates a pickup order and the location auto-fills.

## Related

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Record Field</strong></td><td>The general-purpose field block — Location is a dedicated picker for this specific field.</td><td><a href="/pages/CvoZuH76L8oKeiLSjA0a">/pages/CvoZuH76L8oKeiLSjA0a</a></td></tr><tr><td><strong>Module Variables</strong></td><td>Source values for Order Type Mapping defaults.</td><td><a href="/pages/S9QlmvCWJ8AOsDrFpQtz">/pages/S9QlmvCWJ8AOsDrFpQtz</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.in8sync.com/client-admin-guide/active-workflows/getting-started/transaction-components/location.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
