> For the complete documentation index, see [llms.txt](https://docs.ownchat.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ownchat.app/bot/utility/assign-variable.md).

# Assign Variable

The **Assign Variable** action allows chatbot builders to **store, update, and manage variable** values during a chatbot workflow.

This utility action helps store customer responses, selections, feedback, names, phone numbers, or other dynamic values that can later be reused throughout the chatbot flow.

The walkthrough demonstrates configuring Send Buttons, selecting response storage variables, assigning a value to a variable, and publishing the workflow to production.

{% embed url="<https://app.supademo.com/demo/cmmug89e92e0yf3u9bsl8jt7u?utm_source=link>" %}

### When to Use Assign Variable &#x20;

Use the **Assign Variable** action when your chatbot needs to store or modify values during a conversation.

### Common Use Cases &#x20;

* Saving customer feedback
* Storing user selections
* Tracking customer responses
* Saving order information
* Managing chatbot workflow conditions
* Reusing values later in the flow

**Example Interaction**&#x20;

Bot: How was your experience with our service?\
\
User: Positive

The chatbot stores the response in a variable for future use.

### How to Add Assign Variable &#x20;

Follow these steps to add the **Assign Variable** action to your bot workflow.

1. Open **Bot Builder**
2. Click the menu icon on the selected node
3. Configure the Send Buttons response storage
4. Click **Update**
5. Open the **Utilities** tab
6. Select **Assign Variable**
7. Configure the variable settings
8. Click **Create**
9. Click **Publish** to deploy the workflow

The walkthrough demonstrates configuring the Assign Variable node after a feedback collection button flow.

### Configuring Response Storage in Send Buttons &#x20;

Before assigning a variable, the chatbot response must first be stored.

To configure response storage:

1. Open the **Send Buttons** configuration.

{% embed url="<https://app.supademo.com/demo/cmpari8co0008vp0jspotz74h?utm_source=link>" %}

2. Scroll to the response variable field.

{% embed url="<https://app.supademo.com/demo/cmparp26p000bvp0jf2mtuspg?utm_source=link>" %}

3. Select a storage option for the response.
4. Click **Update** to save the configuration.

{% embed url="<https://app.supademo.com/demo/cmparpycj05vaz80jhneeud0w?utm_source=link>" %}

The walkthrough demonstrates selecting a response storage field before proceeding to variable assignment.

### Accessing the Utilities Section &#x20;

To access the Assign Variable action:

1. Drag the output connector from the previous action.
2. Open the action selection panel.
3. Click the **Utilities** tab.

{% embed url="<https://app.supademo.com/demo/cmparr31n072kxa0jzw7h1w89?utm_source=link>" %}

The Utilities section contains helper functions and workflow automation actions.

### Selecting Assign Variable &#x20;

Inside the Utilities tab:

1. Locate the **Assign Variable** action.
2. Click the action to open the configuration panel.

{% embed url="<https://app.supademo.com/demo/cmparsrlp05voz80jhpsunjuj?utm_source=link>" %}

The walkthrough highlights the Assign Variable action within the Utilities section.

### Assign Variable Configuration &#x20;

When configuring the **Assign Variable** action, several fields must be completed.

#### Action Name &#x20;

The **Action Name** identifies the utility action inside the bot workflow.

This name is visible only within the bot builder.<br>

{% embed url="<https://app.supademo.com/demo/cmpary5ql06vpz70j8u1j7yf2?utm_source=link>" %}

**Example** &#x20;

Stored Feedback\
Assign Customer Selection\
Save User Response

The walkthrough demonstrates renaming the default value to:

Stored feedback

before saving the action.

### Variable Name &#x20;

The **Variable Name** field allows you to select the customer field where the value will be stored.

To configure:

1. Click the **Variable Name** dropdown.
2. Select the required customer field.

The walkthrough specifically selects:

feedback\_shared

from the dropdown menu.<br>

{% embed url="<https://app.supademo.com/demo/cmpas0xzr000dx90jm44p8kbh?utm_source=link>" %}

### Dynamic Value Toggle &#x20;

The **Is Dynamic Value** toggle determines whether the assigned value should be:

* Static or  Dynamically generated from variables

When disabled, the chatbot uses a fixed value entered manually.

#### Value Field &#x20;

The **Value** field defines the value that will be assigned to the selected variable.<br>

{% embed url="<https://app.supademo.com/demo/cmpasjg4r0766xa0jpf2fgm8h?utm_source=link>" %}

Example:

Positive

The walkthrough demonstrates entering a value manually for the **feedback\_shared** variable.<br>

{% embed url="<https://app.supademo.com/demo/cmpaseka205xez80jbcoe8h7h?utm_source=link>" %}

This value can represent:

* Customer feedback
* User selections
* Order status
* Workflow responses

### Add Variable Option &#x20;

The **Add Variable** option allows additional variables to be inserted dynamically into the value field.

This helps create reusable and personalized chatbot workflows.

### Creating the Action &#x20;

After configuring the variable settings:

1. Review the selected variable and value.
2. Click the **Create** button.

The Assign Variable node will now be added to the chatbot workflow.<br>

{% embed url="<https://app.supademo.com/demo/cmpasknh0076fxa0jey78ryk4?utm_source=link>" %}

### Workflow Behavior &#x20;

Once triggered, the **Assign Variable** action:

* Stores user responses
* Updates existing values
* Saves customer selections
* Makes values reusable later in the workflow
* Supports chatbot personalization and automation

The walkthrough specifically notes:

The Assign Variable action is used to store or update values (like customer name, phone number, selection, etc.) so you can use them later in the chatbot flow.<br>

{% embed url="<https://app.supademo.com/demo/cmpast0rr07cvxa0jel8tefyw?utm_source=link>" %}

### Publishing the Bot Changes &#x20;

After configuring the action:

1. Review the workflow setup.
2. Click the **Publish** button.
3. Deploy the updated chatbot workflow to production.

The final page of the walkthrough demonstrates publishing the bot actions successfully.<br>

{% embed url="<https://app.supademo.com/demo/cmpasu8ws0003vi0j9cocb0nh?utm_source=link>" %}

### Example Workflow &#x20;

**Example Chatbot Workflow** &#x20;

Send Feedback Request\
&#x20;       ↓\
Store User Response\
&#x20;       ↓\
Assign Variable → feedback\_shared\
&#x20;       ↓\
Continue Workflow

**Example Interaction** &#x20;

Bot: Would you recommend our service?\
\
User: Yes\
\
System Action:\
feedback\_shared = Positive

The chatbot stores the assigned value and continues the workflow.

### Best Practices &#x20;

Follow these recommendations when using **Assign Variable.**

#### Use meaningful variable names &#x20;

Use descriptive variable names for easier workflow management.

#### Store responses immediately &#x20;

Save important customer responses as soon as they are collected.

#### Use dynamic values when needed &#x20;

Enable dynamic values when variables depend on customer responses.

#### Keep workflows organized &#x20;

Use clear action names to identify workflow logic easily.

#### Publish changes after updates &#x20;

Always publish the workflow after modifying variable assignments.

### Summary &#x20;

The **Assign Variable** action allows chatbot builders to dynamically **store and manage values during chatbot conversations.**

With **Assign Variable,** you can:

* Store customer responses
* Save chatbot selections
* Update workflow variables
* Reuse values later in conversations
* Build personalized and dynamic chatbot workflows

This utility action helps businesses create **smarter chatbot automation and better workflow management inside Ownchat**
