# Dynamic Variables

Dynamic variables can be used to personalize outgoing messages. Personalised content contributes to building a good relationship with contacts where they feel their relevance to the context.

## What are the dynamic variables? <a href="#what-are-the-dynamic-variables" id="what-are-the-dynamic-variables"></a>

You can use a dynamic variable simply by adding a prefix, `@contact` or `@field` to the contact field. The following are the example and usage.

### Contact Variables <a href="#contact-variables" id="contact-variables"></a>

| Variable             | Description                                                                                                                                    |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `@contact.name`      | Is replaced by the full name of the contact (First Name + Last Name).                                                                          |
| `@contact.firstname` | Is replaced by the first name of the contact.                                                                                                  |
| `@contact.lastname`  | Is replaced by the last name of the contact.                                                                                                   |
| `@contact.gender`    | Is replaced by the gender of the contact.                                                                                                      |
| `@contact.location`  | Is replaced by the location of the contact. If the contact has no location stored, it will not be replaced and the actual string will be sent. |

### Custom Field Variables <a href="#custom-field-variables" id="custom-field-variables"></a>

| Variable            | Description                                                                                                                                                                                  |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@contact.email`    | Is replaced by the email address of the contact.                                                                                                                                             |
| `@contact.phone`    | Is replaced by the phone number of the contact.                                                                                                                                              |
| `@field.field_name` | Is replaced by the value in the custom field. For example, if the Custom Field "City" exists and one contact has the value "New York", sending `@field.city` will be replaced by `New York`. |

## How to use a dynamic variable? <a href="#how-to-use-a-dynamic-variable" id="how-to-use-a-dynamic-variable"></a>

### Messaging Console <a href="#messaging-console" id="messaging-console"></a>

You can include a dynamic variable in your message while responding to a contact.![](https://gblobscdn.gitbook.com/assets%2F-L8qsmIDw5_reabURkaE%2F-MC6b9IaV8CK1DQKmy6I%2F-MC6bBx-1ACyrTNl5_K0%2Fezgif-4-af97b66f31e2.gif?alt=media\&token=b850328c-7eae-40b1-9d3c-bae1f0e4c78b)

Besides contact fields, you can also include a custom field by typing the custom field's name.![](https://gblobscdn.gitbook.com/assets%2F-L8qsmIDw5_reabURkaE%2F-MHFjejGSAb3bAgaGwsx%2F-MHFmkVAAITuMgvwl0H-%2Fdynamic%20custom.gif?alt=media\&token=e936cfc7-2adf-4005-ada0-08a67f923245)

### Snippets <a href="#snippets" id="snippets"></a>

You can use dynamic variables in snippets as well.

![Using dynamic variable in snippet](https://gblobscdn.gitbook.com/assets%2F-L8qsmIDw5_reabURkaE%2F-MC6XsgEDCFkQAzoHKpD%2F-MC6aBSEzYhhfUtbrNKJ%2FScreenshot%202020-07-13%20at%205.53.53%20PM.png?alt=media\&token=dd47a10d-2395-467c-8a9c-547dc1a61813)

While composing a snippet content, you can include a dynamic variable to personalise your quick replies.

{% hint style="info" %}
You can have multiple dynamic variables in a single content. Make use of them while composing your messages
{% endhint %}

{% hint style="warning" %}
**Important**: If the field you are trying to send is empty or the field does not exist at all, the string will not be replaced.
{% endhint %}


---

# 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.bonomi.io/bonomi-inbox/dynamic-variables.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.
