> For the complete documentation index, see [llms.txt](https://docs.mydbsync.com/cloud-workflow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mydbsync.com/cloud-workflow/create-your-workflow/actions/context-builder.md).

# Context Builder

The Context Builder action lets you compose a block of text by embedding data-stream field values directly inline, using `{{FieldName}}` placeholder syntax. Instead of alternating between quoted string literals, `VALUE()` calls, and `+` concatenation operators, you write a natural template and the action resolves each placeholder at runtime.

Context Builder produces a single string output, making it a drop-in alternative to the Variable action wherever a Variable output is consumed. Both actions coexist in the action picker. Choose whichever fits your workflow.

## Before you begin

* Identify the field names exposed by your upstream data stream. Field names are matched case-sensitively, so confirm the exact casing before you create your workflow.

## How the placeholder syntax works

Wrap any data-stream field name in double curly braces to reference it in your template:

```
{{FieldName}}
```

At runtime, each placeholder is replaced with the value of the matching field from the current data stream. Static text outside the placeholders passes through unchanged, including line breaks and other whitespace.

<div data-with-frame="true"><figure><img src="/files/nxKr4EqIRWRX3XLJGzTz" alt=""><figcaption></figcaption></figure></div>

**Example:**

```
Customer name is {{Name}}
Industry is {{Industry}}
Website is {{Website}}
```

**Given** a data stream where `Name = "Acme Corp"`, `Industry = "SaaS"`, and `Website = "acme.com"`, the output is:

```
Customer name is Acme Corp
Industry is SaaS
Website is acme.com
```

This is equivalent to the following Variable action expression, without any of the manual syntax:

```
"Customer name is " + VALUE("Name") + "Industry is " + VALUE("Industry") + "Website is " + VALUE("Website")
```

## Add and configure the Context Builder action

{% stepper %}
{% step %}
In the action picker, locate **Context Builder** under the **AI** section. Drag it into your flow at the point where you want to compose the text.
{% endstep %}

{% step %}
Click **Configure**.
{% endstep %}

{% step %}
In the multi-line text area, type your template text.

Insert `{{FieldName}}` wherever you want a data-stream field value to appear. You can add as many placeholders as you need, and you can repeat the same field name more than once.

Use the field picker (if available) to browse the fields exposed by the upstream step and confirm their exact names.<br>

<div data-with-frame="true"><figure><img src="/files/6UsCJMwtOSp15XNFHssq" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
We recommend confirming field name casing against the upstream step before saving, because field name matching is case-sensitive.
{% endhint %}
{% endstep %}

{% step %}
Click **Save**.
{% endstep %}

{% step %}
Click the **Run** icon <img src="/files/NjY054HunjS97YtPuvNr" alt="" data-size="line"> to execute the flow.

Check the step output or console to confirm that each placeholder was resolved and the assembled text looks correct.

<div data-with-frame="true"><figure><img src="/files/3anI63jr8RQYX7SIRDKm" alt=""><figcaption></figcaption></figure></div>

If the action encounters a placeholder that doesn't match any field in the data stream, the step fails with a runtime error before passing any output to downstream steps. See [Troubleshooting](#troubleshooting) for details.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>The step fails with a runtime error mentioning an unknown field</summary>

A placeholder in your template references a field name that doesn't exist in the data stream at execution time. The step stops immediately and doesn't pass any partial output to downstream steps.

To resolve this error:

1. Open the action and review every `{{FieldName}}` placeholder in your template.
2. Compare each field name against the fields exposed by your upstream step. Check for typos and casing differences; the match is case-sensitive.
3. Remove or correct any placeholder that references a field not present in the data stream.
4. Save and re-run the flow.

</details>

<details>

<summary>A placeholder is rendered as literal text in the output</summary>

The placeholder is usually not recognized because of a formatting issue:

* Confirm you used double curly braces on both sides: `{{FieldName}}`, not `{FieldName}` or `{{ FieldName }}` with spaces inside.
* Confirm the field name contains no special characters that could break parsing.

</details>

## What's next

* [Variable action](https://docs.mydbsync.com/cloud-workflow/variable) — the alternative approach to building dynamic text strings using `VALUE()` and `+` concatenation.
* [Implementing conditional logic with If Conditions](https://docs.mydbsync.com/cloud-workflow/if-conditions) — use the string output from Context Builder as input to a condition.
* [Creating and managing queries](https://docs.mydbsync.com/cloud-workflow/ipaas/functional-concepts/query) — learn how to build the upstream queries that populate your data stream fields.
* [Debugging flows](https://docs.google.com/document/d/14MCRfISd6NI_tM7yAUu_ci-mz_Y8PzE_Zffq8f4tjDI/edit#heading=h.q8inv0iuih8v) — techniques for troubleshooting runtime errors in your workflows.
