---
updatedAt: 2025-05-08T20:06:57.000Z
agentTools:
  projectIndex: https://console-docs.gupshup.io/llms.txt
---

# Expression Library in Journey builder Canvas

# Introduction

The Expression Library enhancement in the Modify Variable node is designed to empower bot designers with advanced data manipulation capabilities. By offering a robust set of pre-built functions, this feature eliminates the need for custom code nodes, enabling efficient and seamless variable operations directly within the Journey Builder Canvas.\
This enhancement introduces a dedicated interface for creating and testing expressions, providing an intuitive experience for designers to achieve complex data transformations with ease.

<Image align="center" src="https://files.readme.io/16183d56746c511a6cd2d33d4e0f12e5419c760e94a5d8419335f9ca213be876-image2.png" />

# Key Features

1. Expression Modifier Option:
   * A new **Expression** option in the Modify Variable dropdown menu, fixed at the bottom for easy access.
   * Available even when no search results match other modifier options.
2. Expression Box:
   * A dedicated editor for creating and editing expressions.
   * Supports approximately 180 pre-built functions for manipulating different data types.
   * Enables nesting of functions for advanced data operations.
   * Includes a variable icon to insert variables and a play icon to execute expressions.
3. Test Expression Functionality:
   * Designers can test expressions with sample values to verify results.
   * Outputs or errors are displayed instantly, allowing iterative testing and corrections.
4. Save Validation:
   * Expressions must pass validation before saving.
   * Invalid expressions or mismatched data types disable the Save button, ensuring error-free runtime execution.
5. Error Feedback:
   * Comprehensive error messages for invalid syntax or data mismatches.
   * Suggestions for corrections to guide bot designers.

<br />

# Key Benefits

1. **Enhanced Efficiency:**
   * Reduces dependency on custom code nodes, enabling faster journey development.
2. **Ease of Use:**
   * A clean and intuitive interface designed for bot designers of all experience levels.
   * Comprehensive documentation and test functionality to ensure a smooth user experience.
3. **Robust Functionality:**
   * Pre-built functions simplify complex operations.
   * Support for nesting allows flexibility for advanced use cases.
4. **Error-Free Execution:**
   * Built-in validation and error feedback prevent runtime errors.
   * Designers can confidently deploy expressions with guaranteed stability.

<br />

# How It Works

1. **Accessing the Expression Library:**

   * Navigate to the Modify Variable node and open the Modifier dropdown.
   * Select the Expression option at the bottom of the list.

     ![](https://files.readme.io/5dd27f9050c45e33a4dd19b3470102cd2ff4aed396959c65e0ce14f0910b13da-image.png)
2. **Creating an Expression:**

   * Click on Build Expression open the editor.

     ![](https://files.readme.io/b7dae9f651129afadc01f56b0df72e9826589d63e3025a8f2ac982f168c85ba8-image.png)
   * Use the available functions, insert variables, and nest operations as needed.

     ![](https://files.readme.io/5153b4d9a22cc2e65d0488e3ec1b5307b2441a7e1d4dbbd80a3ad14d5dbba052-image.png)
3. **Testing the Expression:**

   * Add sample values for testing the expression.
   * Click the play icon to execute the test.

     ![](https://files.readme.io/1235430e23454d052f429410d5665dfbb1fd04a65a407bb8ca3b28a50e1bea86-image.png)
   * Review the output or error feedback in the Output Box.
4. **Saving the Expression:**

   * Once validated, click Use Expression to apply the expression to the node.

     ![](https://files.readme.io/b9d72879ada9211a56c8dd5cc7f9ba88393a8663202da3e3d1ec52b632468c26-image.png)
   * **Ensure the "Store in Variable" selection matches the output data type.**

<br />

# Supported Functionalities

1. **180+ Pre-Built Functions:**
   * Handle strings, numbers, dates, arrays, and more.
2. **Nesting Support:**
   * Combine multiple functions for advanced data manipulations.
3. **Validation Rules:**
   * Max character limit: 1000.
   * Up to 10 sample values for testing.
   * Data type compatibility checks for "Store in Variable."

<br />

# Error Handling

1. **Syntax Errors:**
   * Detected and displayed in the Output Box during testing.
   * Clear guidance provided for corrections.
2. **Data Type Mismatches:**
   * Prevent saving of invalid expressions.
   * Output Box highlights mismatches and suggests appropriate fixes.

<br />

# Getting Started

To explore the Expression Library enhancement:

1. Open the **Modify Variable** node in the Journey Builder Canvas.
2. Select the **Expression** option from the Modifier dropdown.
3. Follow the intuitive interface to create, test, and save expressions.

<br />

# FAQs

1. **What happens if I enter an invalid expression?**
   * Errors will be displayed in the Output Box during testing. The Save button will remain disabled until the expression is corrected.
2. **Can I use this feature for all data types?**
   * Yes, the Expression Library supports all standard data types, including strings, numbers, arrays, and dates.
3. **Is real-time typo detection available?**
   * Not yet. However, the Test Expression functionality provides feedback for correcting errors.

This enhancement transforms the Modify Variable node into a powerful tool, offering unparalleled flexibility and ease for bot designers to manipulate data.