> For the complete documentation index, see [llms.txt](https://help.blings.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.blings.io/apps/blings-studio/connectors/expression.md).

# Expression

Use an Expression connector when a connector needs custom JavaScript to calculate a value or control an interaction. Expressions are best for logic that cannot be represented cleanly with a single Dynamic Data field, Live Control value, or direct edit.

<figure><img src="/files/xD0N1YzYvk436tZOYKCZ" alt="Shared Studio connector detail panel showing the expression source tab beside data, live control, and edit source options" width="375"><figcaption></figcaption></figure>

## Options

| Option                        | What it controls                                                    | Notes                                                                                  |
| ----------------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| **Target connector or layer** | The value, layer, or interaction affected by the expression.        | Confirm the expression is attached to the right connector type.                        |
| **Input data**                | Dynamic Data, Live Control, or other values referenced by the code. | Keep input field names aligned with the project data schema.                           |
| **JavaScript code**           | The custom logic used to return a value or trigger behavior.        | Keep the code focused on the connector's job.                                          |
| **Fallback behavior**         | What happens if the expression returns an empty or invalid value.   | Define a safe default before publishing.                                               |
| **Platform editing**          | Whether any connected values should be editable from Platform.      | Avoid exposing code-like controls to operators unless the workflow is designed for it. |
| **Internal description**      | A note explaining the expression purpose.                           | Include the business rule, not just the implementation detail.                         |

## When to Use an Expression

Use an expression when you need to:

* Combine multiple fields into one output.
* Format values in a way the connector options do not support.
* Choose different text, media, color, frame, or visibility behavior from multiple inputs.
* Add custom interaction logic.
* Reuse a business rule that depends on more than one runtime value.

Use Data, Edit, or Live Control instead when a simple field or direct value can do the same job. Simpler connector sources are easier to preview, operate, and maintain.

## Configure an Expression

{% stepper %}
{% step %}

### Define the Desired Output

Write down what the expression must return or trigger, including the fallback behavior.
{% endstep %}

{% step %}

### Confirm Input Fields

Check that every field referenced by the expression exists in Dynamic Data, Live Control, Catalog, or the integration payload.
{% endstep %}

{% step %}

### Add the JavaScript

Add the code in the connector expression area and keep it limited to the current connector behavior.
{% endstep %}

{% step %}

### Test Normal and Missing Values

Preview values that should pass, values that should branch differently, and missing or invalid values.
{% endstep %}

{% step %}

### Document the Rule

Add an internal description so future editors understand why the expression exists.
{% endstep %}
{% endstepper %}

## Success Checks

Before publishing an Expression connector, confirm:

* The expression handles missing, empty, and unexpected values.
* Every referenced field exists in the data setup.
* The output matches the expected type for the connector.
* The expression does not duplicate logic that could be handled by a simple field or live control.
* QA has previewed each meaningful branch of the expression.

{% content-ref url="/pages/vF3GOo8viXK19zuT75hD" %}
[Data in Studio](/apps/blings-studio/data.md)
{% endcontent-ref %}
