---
url: /process-functions/script-checkbox.md
description: Asks the user running the process to tick or untick a checkbox.
---

# script.checkbox

Asks the user running the process to tick or untick a checkbox. Call it in `pre()`. The answer is available to the rest of the process as a `true` or `false` variable with the name you give it.

```js
script.checkbox(messageToUser, variableName, checked)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `messageToUser` | `string` | The label to show next to the checkbox. |
| `variableName` | `string` | The name of the variable to store the answer in. |
| `checked` | `boolean` | Whether the checkbox starts ticked. |

## Examples

```js
function pre() {
    script.checkbox("Include prior year", "includePriorYear", false);
}

function begin() {
    if (includePriorYear) {
        console.log("Loading prior year as well");
    }
}
```

## Related

* [script.prompt](/process-functions/script-prompt)
* [script.note](/process-functions/script-note)
