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

# preferLocation

```ts theme={null}
function preferLocation(locationId, opts?): RuleEntry<"location-preference", object & EntityOnlyRuleOptions>;
```

Softly steers targeted members toward shift patterns at a specific location.

## Parameters

<ResponseField name="locationId" type="string" required>
  The location to prefer
</ResponseField>

<ResponseField name="opts">
  [`EntityOnlyRuleOptions`](./EntityOnlyRuleOptions)

  See [EntityOnlyRuleOptions](./EntityOnlyRuleOptions)
</ResponseField>

## Returns

`RuleEntry`\<`"location-preference"`, `object` & [`EntityOnlyRuleOptions`](./EntityOnlyRuleOptions)>

Penalizes assignment to shift patterns whose `locationId` does not
match the preferred location. Use `priority` to control preference strength.
The member is still assigned elsewhere when coverage or hard constraints
require it.
