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

# User-selected attribute values

> Let users switch to an admin-provisioned user attribute value from the File menu, instead of an admin reassigning it.

With user-selected attribute values, a user can switch their own [user attribute](/administration/users/attributes) to a value an Organization Admin has provisioned for them.

A switched value replaces the user's assigned value for the rest of the session. It applies everywhere Omni reads the user's attribute values, including [access filters](/modeling/topics/parameters/access-filters), [access grants](/modeling/models/access-grants), [shared extension routing](/modeling/develop/shared-extensions), and [dynamic connection environments](/connect-data/dynamic-environments).

## Requirements

To allow users to switch their attribute values, an **Organization Admin** first needs to set up user attributes to be switchable. Each attribute is individually configured.

<h2 id="configure-switching">
  Making user attribute values switchable
</h2>

<Note>
  **Organization Admin** permissions are required to modify user attributes.
</Note>

Users can only switch an attribute to values that an Organization Admin has provisioned. This ensures that customer-facing users retain their assigned values by default.

Allowed values can be provisioned for individual users or user groups. A user can switch to any value granted to them directly, plus any value granted to one of their groups.

<Warning>
  Shared extensions and access filters often route on the same attribute you provision. When you grant a value, you grant access to everything that value controls, such as another tenant's rows behind an access filter. Provision only the values a user or group should see.
</Warning>

<h3 id="switch-users">
  Individual users
</h3>

<Tabs sync={false}>
  <Tab title="Omni UI" icon="window-maximize" id="ui-switch-user">
    1. Navigate to **Settings > Users** and open the user.
    2. Click the **Attributes** tab. The **Allowed values** column shows the values the user can switch each attribute to, including values inherited from their groups.
    3. Find the attribute's row and click **Manage**.
    4. You can either:
       * **Add the values the user can switch to** by entering the specific values.
       * **Let the user switch to any value** by enabling **Allow any value**. Omni suggests values already assigned to users in your organization.

             <Note>
               If one of the user's groups already allows any value, Omni turns on **Allow any value** for the user and locks it. In this case, modify the setting on the group instead.
             </Note>
    5. Click **Save**.
  </Tab>

  <Tab title="API" icon="cloud" id="api-switch-user">
    To provision allowed values for a specific user, use the [Set switchable values for a user or group endpoint](/api/user-attributes/set-switchable-values-for-a-user-or-group) and provide the `user_id` property in the request body:

    ```http theme={null}
    curl --request PUT \
      --url https://{your-omni-instance}.omniapp.co/api/v1/user-attributes/{userAttributeId}/selectable-values \
      --header 'Authorization: Bearer {token}' \
      --header 'Content-Type: application/json' \
      --data '
    {
      "user_id": "8f14e45f-ceea-467a-9c2b-8f1d2a3b4c5d",
      "values": [
        "acme",
        "globex"
      ]
    }
    '
    ```
  </Tab>
</Tabs>

<h3 id="switch-groups">
  User groups
</h3>

<Tabs sync={false}>
  <Tab title="Omni UI" icon="window-maximize" id="ui-switch-group">
    1. Navigate to **Settings > Groups** and open the group.
    2. Click the **Settings** tab. The **Allowed user attribute values** table lists every user attribute with the values the group can switch to.
    3. Find the attribute's row and click **Manage**.
    4. You can either:
       * **Add the values the group members can switch to** by entering the specific values.
       * **Let group members switch to any value** by enabling **Allow any value**. Omni suggests values already assigned to users in your organization.
    5. Click **Save**.
  </Tab>

  <Tab title="API" icon="cloud" id="api-switch-group">
    To provision allowed values for a user group, use the [Set switchable values for a user or group endpoint](/api/user-attributes/set-switchable-values-for-a-user-or-group) and provide the `group_id` property in the request body:

    ```http theme={null}
    curl --request PUT \
      --url https://{your-omni-org}.omniapp.co/api/v1/user-attributes/{userAttributeId}/selectable-values \
      --header 'Authorization: Bearer {token}' \
      --header 'Content-Type: application/json' \
      --data '
    {
      "group_id": "3c1a9b7e-2d4f-4a8b-9e0c-1f2a3b4c5d6e",
      "values": [
        "blobsinc",
        "blobsrus"
      ]
    }
    '
    ```
  </Tab>
</Tabs>

<h2 id="user-switch">
  Switching an attribute value as a user
</h2>

If an Organization Admin has provisioned values for you, you can switch the value of the attribute in the Omni UI or through the API.

<Tabs sync={false}>
  <Tab title="Omni UI" icon="window-maximize" id="ui-change">
    1. In a document or the model IDE, navigate to **File > User attributes**.
    2. Click the attribute you want to switch.
    3. Click a value in the list. If the attribute allows any value, you can type a value and press **Enter** instead. For an attribute that allows multiple values, click each value you want.

       If an attribute allows any value or has more than 10 provisioned values, a search box appears at the top of the submenu. Use it to filter the list or to type a value.

    Omni automatically saves your selections and reruns affected queries against the new value or values.

    <Note>
      While your session runs on one or more switched values, a badge appears next to your profile icon. Hover the badge to see which attributes are switched and to which values.
    </Note>
  </Tab>

  <Tab title="API" icon="cloud" id="api-change">
    To switch an attribute value programmatically, use the [Switch an attribute value for the current user endpoint](/api/user-attributes/switch-an-attribute-value-for-the-current-user):

    ```http theme={null}
    curl --request PUT \
      --url https://{your-omni-org}.omniapp.co/api/v1/user-attribute-selections \
      --header 'Authorization: Bearer {token}' \
      --header 'Content-Type: application/json' \
      --data '
    {
      "user_attribute_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "values": [
        "blobsrus"
      ]
    }
    '
    ```
  </Tab>
</Tabs>

## Limitations

* **Switched values do not apply in these contexts**. In these contexts, the user's assigned value is used:
  * Scheduled runs
  * Schedule forms
  * The email-only users API
  * Chat sharing
* **A revoked value stops applying the next time Omni reads the user's attributes.** If an admin removes a value a user switched to, the user falls back to their assigned value.

## Troubleshooting

<AccordionGroup>
  <Accordion title="The User attributes menu doesn't appear in the File menu">
    If you don't see the **File > User attributes** menu, it means that an attribute value hasn't been provisioned for you.

    An Organization Admin should check the **Allowed values** column on the user's **Attributes** tab. If the user is an **Organization Admin**, they can always switch, so no provisioned value is needed.
  </Accordion>

  <Accordion title="A switched value isn't taking effect">
    If a switched value isn't taking effect, an admin may have revoked the value after you switched to it. It's also possible that the value wasn't granted to you or a group you belong to.

    An Organization Admin should confirm the value still appears in the **Allowed values** column on the user's **Attributes** tab.
  </Accordion>
</AccordionGroup>

## Next steps

* [User attributes](/administration/users/attributes) - Learn how attributes are defined and assigned
* [User groups](/administration/users/groups) - Manage permissions for multiple users at once
* [Dynamic connection environments](/connect-data/dynamic-environments) - See how an attribute value can route a user's connection environment
* [Shared extension models](/modeling/develop/shared-extensions) - See how an attribute value routes a user to a model extension


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.