---
alias: "fc.attribute.locationId"
aliases:
  - fc.attribute.locationId
category: field
module: Core
---
# fc.attribute.locationId

Location ID dropdown selector for assigning a primary location to a user. Conditionally shows/hides based on user type (required for AGENT, optional otherwise).

## When to Use
- Create/edit user drawers where a location must be assigned
- Agent user forms requiring a mandatory location
- Any form where location selection is conditional on context

## Key Props
| Prop | Type | Required | What it controls |
|------|------|----------|------------------|
| `name` | string | Yes | Field name in the form |
| `label` | string | No | Field label (supports i18n keys) |
| `value` | string | No | Pre-selected location ID |
| `mandatory` | boolean | No | Whether the field is required |

## Data Binding
The component queries available locations and presents them in a dropdown. When the "+ ADD LOCATION" button is not pressed, no validation is applied. Once expanded, the field validates that a non-empty value is submitted.

## Descendants
No.

## Gotchas
- The component has two states: collapsed (no validation) and expanded (required validation). This allows location to be optional for non-AGENT user types.
- Location ID is mandatory from the backend perspective, but this component conditionally avoids system validation.
- Designed specifically for the Create User drawer workflow.

## Manifest Example
```json
{
  "component": "fc.attribute.locationId",
  "props": {
    "name": "primaryLocationId",
    "label": "i18n:fc.user.primaryLocation"
  }
}
```

## AI Parse Notes
- **Primary intent:** Declarative Mystique component definition for manifests.
- **Selection signals:** Match by `alias`, category, and required `Key Props`.
- **Assembly hints:** Combine with compatible parent/child components listed in `Composition Patterns`.
- **Safety checks:** Validate required props and data bindings before manifest generation.
