> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.cxplanner.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Use scripting within a checklist

## Overview: checklist scripting

Checklist scripting lets you automatically format entered values or reassign tasks based on PASS or FAIL, which is used when many line items need consistent units or automatic ownership changes on fail.

* Your role must be **Manager** or higher.
* You can find the menu at Checklist module - enable the **Scripting** column.
* This changes checklist data values, task or observation ownership, and exports that include scripted columns.

|| Only users with the project role Manager or higher can enable and configure scripting.

## How to use scripting within a checklist

1. Open the **Checklist module** in your project.
2. Enable the **Scripting** column for the checklist.
3. Define rules for modifying data values:

```
=> Update = <true | false>
=> Column = <name of the column>
=> Prefix = <any text>
=> Replace = <true | false>
=> Append = <true | false>
```

4. Or define task reassignment rules after PASS or FAIL:

```
=> reassignto = ttj@cxplanner.com
=> reassigntoonfail = ttj@cxplanner.com
```

5. Save the checklist.
6. Test by entering a value in the scripted column.

![Screenshot: Use scripting within a checklist - value transformed to Length](https://storage.crisp.chat/users/helpdesk/website/ea2cfd7bb6130800/image_6vm1dj.png)

## Results: checklist scripting

* Input values can be prefixed, replaced, or appended
* Values are stored in the target column you define
* Task assignment rules move ownership of a line item when PASS or FAIL is clicked

Example:

1. A user enters `200` in a scripted column.
2. The script updates the value to `Length: 200`.
3. If the result is FAIL, the task can be reassigned automatically to another user.

![Screenshot: Use scripting within a checklist - example before automation](https://storage.crisp.chat/users/helpdesk/website/ea2cfd7bb6130800/image_bwy3qr.png)

![Screenshot: Use scripting within a checklist - example after automation](https://storage.crisp.chat/users/helpdesk/website/ea2cfd7bb6130800/image_1guuhl8.png)

## Troubleshooting: checklist scripting

| Problem | Cause | Solution |
|---|---|---|
| Script does not run | Scripting column is not enabled | Enable the Scripting column in the checklist settings |
| Values not updating as expected | Rule syntax is incorrect | Check Update, Column, Prefix, Replace, and Append values |
| Tasks not reassigned on FAIL | Wrong email, or user is not on the project | Verify the email in `reassigntoonfail` and confirm the user is a project member |
| Scripted values missing in export or PDF | Scripted column is not included in the output setup | Add the scripted column to the export or template output setup |