> ## Documentation Index
> Fetch the complete documentation index at: https://helpdocs.gavel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Formatting Questions

> Use previous supplied answers in your questions and choices. Customize the formatting and fonts throughout your workflow questions — including bold, italics, headings, links, bullets, accordions, and more.

## Using prior answers inside questions

In addition to show/hide logic, you can reference a prior answer directly inside the text of a later question. This is useful for personalizing question wording or confirming what the client previously entered.

Use the `${VariableName}` syntax anywhere in a question's label, helper text, or answer choices:

```text theme={null}
Hello ${ClientFirstName}. What is your current mailing address?
```

You can also use a prior answer as one of the selectable choices in a multiple-choice question. For example, if an earlier question collected a spouse's name in `SpouseName`, you can offer it as a choice later:

```text theme={null}
Who should be named as the primary beneficiary?

A. ${SpouseName}
B. A trust
C. Other
```

If the client entered "Richard" for `SpouseName`, Choice A will display as "Richard" in the questionnaire.

***

## Showing conditional text inside a question

You can display different text within a question's instruction block based on a prior answer. Use this pattern in an Instruction block:

```text theme={null}
${ "You are married" if MaritalStatus == "Married" else "You are not married" }
```

For more complex conditional content — such as showing entire paragraphs — use Instruction blocks together with Calculations (Invisible Logic). You can also show inline messages that depend on calculations:

```text theme={null}
${ "You do not qualify. Please stop." if ((Income + Assets) < 10) else "You qualify. Please proceed." }
```

Date-based conditions work the same way:

```text theme={null}
${ "We are sorry. You are too late." if date_difference(starting=FilingDate).days > 30 else "Great. Let's continue." }
```

***

## Specialized Formatting

<Note>
  Document formatting can be done directly in the document using standard Word features, so you will not need the instructions below for document formatting.
</Note>

Customize the formatting and fonts throughout your workflow using rich text formatting in Markdown. Almost anything is possible formatting-wise. If you don't see it below, you can ask us or check out the options [here](https://www.markdownguide.org/basic-syntax/).

### Customize fonts in your questions

| If you write                    | It will display               |
| ------------------------------- | ----------------------------- |
| `*My italic text*`              | *My italic text*              |
| `**My bold text**`              | **My bold text**              |
| `***My bold and italic text***` | ***My bold and italic text*** |
| \`\`emphasized` text`           | `emphasized` text             |

***

### Add grey line dividers

To add grey line dividers between phrases, use three or more dashed lines on a separate line, separated by hard returns like so:

```markdown theme={null}
Some text above

---

Some text below
```

This will output a horizontal divider between the two sections.

***

### Add a hyperlink

If you write:

```markdown theme={null}
[Link text here](https://www.gavel.io)
```

It will display: [Link text here](https://www.gavel.io)

If you would like it to open in a new tab:

```html theme={null}
<a target="_blank" href="https://www.gavel.io">Link Text Here</a>
```

### Add a Button hyperlink

You can add a button anywhere in your interview workflow to link to any site, like this:

```markdown theme={null}
${ action_button_html("https://www.gavel.io", label="Visit our web site") }
```

Replace the items in quotations with your link and what you want the text to look like.

***

### Add bullet points

Use the `*` sign and skip a line to add a bullet point, like this:

```markdown theme={null}
* Bullet 1
* Bullet 2
```

***

### Add additional line breaks

Use `<br>` to add a line space, like this:

```markdown theme={null}
Some text here
<br>
Some text here
```

***

### Change the sizing of questions

Use `#` signs to increase or decrease the standard size of the font on the questionnaire. For example, using:

```markdown theme={null}
# Heading
## Subheading
### Sub-subheading
```

***

### Create an "Email To" link

To allow someone to click on your link and have it open up an email address, use the following:

```html theme={null}
<a href="mailto:email@example.com">email@example.com</a>
```

***

### Create a "Call Phone Number" link

To allow someone to click on your link and have it attempt to call a phone number, you can use the following:

```markdown theme={null}
[555-555-5555](tel:5555555555)
```

***

### Create a collapsible section of text (accordion)

The following will allow you to create a collapsible section. Replace only the text inside the tags below:

```html theme={null}
<details>
<summary>Click to expand!</summary>
Collapsed text here.
</details>
```

## Incorporate Videos and Files

Embed videos, images and files on the pages of your workflow to provide users more guidance or visuals.

### Add Videos to your workflow

To embed a YouTube or Vimeo video into your workflow, you should:

1. Go to your YouTube or Vimeo video, and get the shareable link.
2. Use the ID of that URL (the end of the URL) between brackets like this: \[YOUTUBE urlhere]  or \[VIMEO VideoIDhere] and add this where you want the video to appear in your workflow.

###### Example:

If your URL is [https://youtu.be/ee1j5a1\_Stk](https://youtu.be/ee1j5a1_Stk), you will use: \[YOUTUBE ee1j5a1\_Stk].

### Add Images to your workflow

Images work the same way, except that you first need to load your image as follows:

1. Add your image file to Gavel under Dashboard > Files > Images
2. Reference the file name where you want it to appear in your questionnaire like this:

###### \[FILE FileName.png]

If you want your file to be larger, you can amplify it to a certain percentage of the original file. For example, the following will render an image that is 200% of the original file size:

\[FILE FileName.png, 200%]

### Add Documents and Document Previews

Adding Word or PDF documents within your questionnaire allows you to provide your users with supplemental materials or display document previews before collecting payment. To add a document preview into your workflow, you should:

1. Add the document to your workflow under Documents Templates
2. Reference the file name where you want it to appear in your questionnaire like this:

`${DocumentName}`

You can specify the file type displayed by adding the file type extension to the end of the document name, like this:

`${DocumentName.docx}` `${DocumentName.pdf}`

Your users can click on the document preview to download the file.

If you do not want to generate a copy of these documents at the end of the workflow, you can hide them using [output document logic](https://helpdocs.gavel.io/workflows/document-settings).
