> For the complete documentation index, see [llms.txt](https://help.metaforms.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.metaforms.ai/data-processing/python/step-3-reviewing-and-editing-scripts.md).

# Step 3: Reviewing and Editing Validation Scripts

Before running your checks, it is important to review the AI-generated scripts to ensure they match your expectations. The AI acts as a copilot — it handles the bulk of script generation, but human review is essential to catch edge cases, confirm business logic, and ensure accuracy.

<figure><img src="/files/d2f604IDgQkDHc1dps9p" alt=""><figcaption></figcaption></figure>

### Review the Generated Code

Expand any check in the Checks view to see the full validation script. Each script is self-contained Python code that targets a single question. Read through the logic to confirm it aligns with the questionnaire's intended behavior.

Once you are satisfied that a script is correct, you can mark it as **Reviewed**. This helps you track progress across a large survey — you can quickly see which checks have been vetted and which still need attention.

### Make Manual Edits

If the generated script needs adjustments, you can edit it directly in the built-in code editor. Changes are saved within the project. Metaforms respects your manual edits — any code you write or modify will be preserved, even if you later ask the AI to regenerate other parts of the project.

This is useful for adding custom checks that go beyond the standard validations (e.g., cross-question consistency rules) or correcting a check where the AI misinterpreted the questionnaire logic.

### Use the AI Chat to Modify Scripts

Instead of editing code directly, you can use the **AI chat interface** to request changes in natural language. For example:

* *"Add a check that Q3 should be skipped if Q1 equals 2."*
* *"The termination condition for S1 should flag respondents who answered 'No' but were not terminated."*
* *"Change the valid range for Q7 from 1–5 to 1–7."*

The AI will update the script accordingly. If your instruction is ambiguous, it will ask clarifying questions before making changes. This makes it accessible even if you are not comfortable writing Python code yourself.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.metaforms.ai/data-processing/python/step-3-reviewing-and-editing-scripts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
