# Assign

{% hint style="info" %}
**Use Case**

* Set initial values for aliases in a request
* Allows customization of a request beyond its initial recorded state
  {% endhint %}

Think of aliases as template variables within a request which are resolved before a request is replayed. For example, let's say we use the following option:

```
--assign ":userId=1"
```

and we are about to replay:

```
GET /users/1
```

and we have defined the endpoint as such (where :userId is an [alias](https://docs.stoobly.com/experimental/experimental-features/aliases)):

```
GET /users/:userId
```

Then the replayed request will actually be:

```
GET /users/1
```

This concept works for query params, headers and body params (for requests that have a parseable body).

## CLI Examples

```shell
stoobly-agent scenario run --assign ":userId=1" "<SCENARIO-KEY>"
```

```shell
stoobly-agent scenario test --assign ":userId=1" "<SCENARIO-KEY>"
```

```shell
stoobly-agent request run --assign ":accessToken=secretToken" "<REQUEST-KEY>"
```

```shell
stoobly-agent request test --assign ":accessToken=secretToken" --assign ":userId=1" "<REQUEST-KEY>"
```

## Configuring Resolve Strategy

Now let's say we assign two values to the alias :userId, for example:

```shell
stoobly-agent scenario run --assign ":userId=1" --assign ":userId=2" "<SCENARIO-KEY>"
```

In this case, how do we determine which value gets resolved first?
