> 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/format-a-variable.md).

# Format a Variable

The **Format a Variable** action allows chatbot builders to **convert and format variable values** into a clean and readable structure during chatbot workflows.

This utility action is commonly used for formatting **date variables**, especially when converting system-generated ISO date formats into user-friendly formats such as DD/MM/YYYY.

The walkthrough demonstrates configuring variable formatting settings, selecting input and output date formats, creating variables, and publishing the updated bot workflow.

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

### When to Use Format a Variable &#x20;

Use the **Format a Variable** action when your chatbot needs to display data in a cleaner or more readable format.

#### Common Use Cases &#x20;

* Formatting delivery dates
* Formatting appointment schedules
* Converting ISO date formats
* Displaying readable customer dates
* Standardizing workflow outputs

**Example Interaction** &#x20;

Bot: Your appointment is scheduled on 25/03/2026.

The chatbot converts a raw ISO date value into a user-friendly format before displaying it.

### How to Add Format a Variable &#x20;

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

1. Open **Bot Builder**
2. Drag and drop the **Format a Variable** node
3. Open the **Utilities** tab
4. Select **Format a Variable**
5. Configure the formatting settings
6. Select or create a response variable
7. Click **Create**
8. Click **Publish** to deploy the workflow

The walkthrough shows the Format a Variable node connected after a Get Dynamic Date action.

### Accessing the Utilities Section &#x20;

To access the **Format a Variable** action:

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

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

The Utilities section contains workflow automation and formatting actions.

### Selecting Format a Variable &#x20;

Inside the Utilities tab:

1. Locate **Format a Variable**
2. Click the action to open the configuration panel.<br>

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

The walkthrough highlights the Format a Variable utility action within the Utilities section.

### Format a Variable Configuration &#x20;

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

#### Action Name &#x20;

The **Action Name** identifies the formatting action inside the workflow.

This name is visible only within the bot builder.

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

**Example** &#x20;

Format Delivery Date\
Format Appointment Date\
Convert Date Format

The walkthrough demonstrates entering a descriptive action name before saving the configuration.

### Date to be Formatted &#x20;

The **Date to be Formatted** field specifies the variable that contains the original date value.

To configure:

1. Click **Add Variable**

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

2. Select the required variable from the list

The walkthrough specifically selects:

delivery\_date

from the variables list.

The selected variable is inserted into the field as:

{{variables.delivery\_date}}<br>

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

This variable contains the original date value that will be formatted.

### Input Format &#x20;

The **Input Format** field defines the format of the incoming date value.

To configure:

1. Click the **Input Format** dropdown.
2. Select the appropriate format.<br>

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

Available formats shown in the walkthrough include:

* MM/DD/YYYY
* DD/MM/YYYY
* ISO DateTime with Millis (Z)

The walkthrough specifically selects:

ISO DateTime with Millis (Z)

for the incoming date format.

### Output Format &#x20;

The **Output Format** field defines how the formatted date should appear after conversion.

To configure:

1. Open the **Output Format** dropdown.
2. Select the preferred output format.<br>

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

The walkthrough specifically selects:

DD/MM/YYYY

for the final formatted appointment date.

### Store Response To &#x20;

The **Store Response to** field defines where the formatted value should be saved.

To configure:

1. Click the **Store Response to** dropdown.

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

2. Select an existing customer field or create a new variable.

The walkthrough demonstrates storing the formatted date in:

corrected\_date<br>

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

### Creating a New Variable &#x20;

If a variable does not already exist:

1. Click **Create Variable**
2. Select the variable type
3. Click **Create Variable** to finalize the configuration

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

The walkthrough demonstrates selecting:

Number

as the variable type before creating the new variable.

### Creating the Action &#x20;

After configuring all formatting settings:

1. Review the selected formats and variables.
2. Click the **Create** button.<br>

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

The Format a Variable node will now be added to the workflow.

### Workflow Behavior &#x20;

Once triggered, the Format a Variable action:

* Converts raw variable values
* Formats date variables automatically
* Standardizes chatbot output formats
* Stores the formatted result in a variable
* Improves readability for customers

The walkthrough specifically notes:

We use the Format a Variable action to convert or change the format of a variable dates into a clean and readable format.\
<https://app.supademo.com/demo/cmpav3eah060kz80j5046ou8m?utm_source=link>

***

Publishing the Bot Changes &#x20;

After configuring the action:

1. Review the workflow setup.
2. Click the Publish button.\
   <https://app.supademo.com/demo/cmpav9bny07jnxa0jbfmlsbur?utm_source=link>
3. Deploy the updated bot workflow to production.

The final page of the walkthrough demonstrates publishing the workflow successfully.

***

Example Workflow &#x20;

Example Chatbot Workflow &#x20;

Get Dynamic Date\
&#x20;       ↓\
Format a Variable\
&#x20;       ↓\
Store Response → corrected\_date\
&#x20;       ↓\
Send Appointment Confirmation

***

Example Interaction &#x20;

Raw Date:\
2026-03-25T10:30:00.000Z\
\
Formatted Date:\
25/03/2026

The chatbot converts the raw ISO date into a clean and readable format before sending it to the customer.

***

Best Practices &#x20;

Follow these recommendations when using Format a Variable.

Use readable output formats &#x20;

Choose date formats that are easy for customers to understand.

Match the correct input format &#x20;

Ensure the input format matches the original variable structure.

Use descriptive variable names &#x20;

Store formatted outputs in clearly named variables.

Standardize date formats &#x20;

Maintain consistent formatting across chatbot workflows.

Test formatting before publishing &#x20;

Verify that the converted values display correctly.

***

Summary &#x20;

The Format a Variable action allows chatbot builders to convert and standardize variable formats inside chatbot workflows.

With Format a Variable, you can:

* Convert raw date formats
* Display readable appointment or delivery dates
* Standardize chatbot output values
* Store formatted values in variables
* Improve chatbot response readability

This utility action helps businesses create clean, user-friendly chatbot responses and maintain consistent data formatting throughout Ownchat workflows.
