# Dialog step: ask a person mid-automation

How the Truetask automation Dialog step shows a person a result or asks for answers, waits for them, and follows the branch of the button they press.

URL: https://docs.truetask.io/automations/dialog

The **Dialog** step puts something in front of a person in the middle of a Truetask automation run: it either shows a result, or asks with fields to fill in and buttons to press, and the run waits until someone answers.
Each button is an output on the node, so the answer decides which branch the run carries on along.

![A Dialog shown during a Truetask automation run: a short note, a required one-choice question, a several-choices question and a Submit button](https://docs.truetask.io/screenshots/automation-dialog-run.webp)

It sits in the **Communication** group of the palette.

## Showing or asking

A Dialog does one of two things, depending on what you put in it.

| Shape | What happens |
| --- | --- |
| **Shows** a result: content, no fields, at most one button | The run does not wait. It carries on at once, and the Dialog is shown to whoever started the run when it ends. |
| **Asks**: any field, or two or more buttons | The run pauses at the Dialog until someone answers, then carries on along the pressed button's branch. |

A Dialog that asks with fields but no buttons of its own gets two: **Continue** and **Cancel**, in each person's language.
**Cancel** skips the fields.
A Dialog with nothing in it, no title, no content and no fields, cannot be switched on.

## Who answers

Where the Dialog opens depends on how the run started.

- **A run started by hand** opens the Dialog on the device of the person who started it, as soon as the run reaches the step.
- **A run an event started** has nobody at a screen, so the Dialog is asked on the run's task, as a question for the people in **Who answers**.

| Who answers | Who gets the question |
| --- | --- |
| **The task's assignees** | Everyone assigned to the task. The default. |
| **Whoever caused the event** | The person whose action fired the trigger |
| **A chosen person** | One member you pick. A question goes to people, never to an agent. |

The question shows on the task with the automation's name and how long it waits, and answering it carries the run on.
Dismissing it ends the run without an answer.
A Dialog that asks needs a task when an event starts the run; with none, the step fails.

**Waits up to** is how long the run waits for an answer, from 1 to 720 hours, 24 by default.
When it runs out, the run ends: nobody answered in time.
If the task is finished another way first, the question closes and the run ends with it.

**Also post it as a comment on the tasks** posts the Dialog's title and content on each task the run works on, as the automation's comment.
It is how a result Dialog reaches people when an event, not a person, started the run.

## Building it

The node's config panel shows the title, the **Parts** the Dialog holds, its buttons and its settings.
**Edit content**, or a click on any part, opens the composer, a workbench over the builder in three columns.

| Column | What it holds |
| --- | --- |
| **The Dialog's parts** | The outline: **Content**, **Fields** and **Buttons**, each with its own add button, and **Add** for the whole catalog with a search |
| **Settings of the selected part** | The settings of whatever is selected in the outline |
| **Preview** | The Dialog as people will see it, drawn live as you edit |

![The Dialog composer in Truetask: the outline of content, fields and buttons, the settings of a selected slider field, and the live preview for a chosen task](https://docs.truetask.io/screenshots/automation-dialog-composer.webp)

The preview draws the Dialog with the placeholders filled in for a real task you choose.
Without one, it shows the Dialog as written, with options from data marked as filled in when a run reaches the step.
A part that would stop a run is marked in the outline, and the automation is not saved until every marked part holds.

The title is typed on its own row and takes placeholders.
Every text in a Dialog takes placeholders, filled in when the run reaches the step.

### Content

Content is what the Dialog shows, up to 20 parts.

| Group | Parts |
| --- | --- |
| **Content** | Text, Callout, Badges, List, Steps, Stats, Properties, Table, Chart, Progress, Files, People, Tasks, Code, Test results, Picture, Links, Sources, Empty state, Separator |
| **Layout** | Section, Panel, Report, Columns, Tabs, Accordion |

The layout parts hold other parts.
**Files** can offer a file a [Make a file](https://docs.truetask.io/automations/actions#files) step made, to download.
**Sources** lists the web pages something was based on, and **Test results** the suites with what passed, failed and was skipped, the same way an agent's answer shows them.

### Fields

Fields are what the Dialog asks, up to 20.

| Field | What it takes |
| --- | --- |
| **Short text** and **Long text** | One line, or several |
| **Email address** and **Web address** | Text that must be an address or a link |
| **Number** and **Whole number** | A number, with or without decimals |
| **Slider** | A number picked between two bounds |
| **Switch** and **Checkbox** | Yes or no |
| **One choice** and **Several choices** | Options, fixed or taken from the board |
| **Date**, **Date and time**, **Date range** | A day, a day and a time, or a start and an end day |

Each field has a **Label** and an **Id**, which follows the label until you write your own.
Depending on its kind it also takes **Required**, a **Help line**, **Placeholder text**, **Default**, **Lowest**, **Highest** and **Step**, or **Shortest** and **Longest**.

A choice field takes **Fixed options**, or **Options from data**, filled in when the run reaches the step.

| Options from data | The options |
| --- | --- |
| **The board's lists** | Every list on the board |
| **The board's members** | Every member of the board |
| **The board's tags** | Every tag on the board |
| **A field's choices** | The choices of one of the board's choice fields |
| **An earlier web request's reply** | A list inside the reply of an [HTTP request](https://docs.truetask.io/automations/actions#http-request) step before this one, at a path such as `items` or `data.rows` |

**Also offer** adds fixed options beside the ones from data, and **Allow another answer** gives a box for the person's own words.

**Ask once per task** repeats a field for each task the run works on, such as every task of a run on selected tasks.

### Buttons

A Dialog has up to four buttons, typed straight on the node's face.
Each one has a label and a **Style**: primary, secondary or destructive.
One button at most is primary: it is the one black button, and Enter presses it.
A button marked **Skips fields** carries on without checking the answers, the way Cancel does.

Every button is an output handle on the node.
Wire each one to the steps that should follow it; a button with no edge ends the run there.
Renaming a button keeps its edge, and removing a button removes its edge.

## Using the answer

The steps after the Dialog read the answer through placeholders named after the step.

| Token | Value |
| --- | --- |
| `{dialog.<name>.<field id>}` | The answer to one field: text as typed, a number as written, yes or no as `true` or `false`, several picks as `a, b`, a range as `start - end` |
| `{dialog.<name>.<field id>.start}` and `.end` | The two days of a date range |
| `{dialog.<name>.button}` | The id of the button pressed |
| `{dialog.<name>}` | The whole answer as JSON |

A field asked once per task reads as the answer for the task a For each is on, or all the answers joined with commas.
The placeholder picker lists these tokens for every Dialog upstream of the node you are editing.
Many steps take an answer where they take a number or a date: Shift dates takes a number answer, Milestone date a date answer, and Account on or off a person.

## Inside a For each

A Dialog inside a For each asks once per item.
The run pauses at each one, and the answer carries that pass of the loop on before the next item asks.

## Running it from the builder

**Run** in the builder toolbar starts a run by hand, so a Dialog in it opens on your screen.
While the run waits, the Last run panel says **Waiting for an answer** and offers **Answer** to bring the Dialog back, and **Cancel**.
A result Dialog's content is kept in the panel under **Shown**.
See [Runs and logs](https://docs.truetask.io/automations/runs).

## Related

- [Actions and logic](https://docs.truetask.io/automations/actions)
- [Placeholders](https://docs.truetask.io/automations/placeholders)
- [Runs and logs](https://docs.truetask.io/automations/runs)
- [Builder](https://docs.truetask.io/automations/builder)
