> 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/survey-programming-dimensions/programming-with-ai.md).

# Programming with AI

MetaForms includes a built-in AI agent that helps you program survey questions, quotas, and logic directly from the Build interface. You can interact with it through the chat panel or use the inline Generate widget for quick edits.

***

### Programming Questions via AI Assistant

**Step 1:** Ask the agent to program questions — for example, *"Program the first five questions from the questionnaire"* (or specify any section or range).

![](https://usercontent.in.prod.clueso.io/743138ba-7933-4a1a-90b2-26ddeb90ccbd/05bff956-b6b9-43fb-a3e7-da02dc5a8ddc/72abdf46-28de-4a4d-984b-fc8019b95247/images/862f500b-3938-438d-b2ac-1ef0186b1cab.png)

**Step 2:** The agent updates your metadata and routing code based on your request. Review the proposed changes in the script panel on the left.

![](https://usercontent.in.prod.clueso.io/743138ba-7933-4a1a-90b2-26ddeb90ccbd/05bff956-b6b9-43fb-a3e7-da02dc5a8ddc/72abdf46-28de-4a4d-984b-fc8019b95247/images/1d9d4001-b242-4c9f-9665-130d6b13ca2e.png)

**Step 3:** Click **Accept All** or **Reject All** to finalize or dismiss the changes. Make sure to apply your decision in both the **Metadata** and **Routing** tabs.

![](https://usercontent.in.prod.clueso.io/743138ba-7933-4a1a-90b2-26ddeb90ccbd/05bff956-b6b9-43fb-a3e7-da02dc5a8ddc/72abdf46-28de-4a4d-984b-fc8019b95247/images/35137e21-4d58-4487-b2e6-9be27ea048a9.png)

***

### Programming Quotas

**Step 4:** To generate quotas, ask the agent in a new or existing chat — for example, *"Program quotas based on the given QNR."*

![](https://usercontent.in.prod.clueso.io/743138ba-7933-4a1a-90b2-26ddeb90ccbd/05bff956-b6b9-43fb-a3e7-da02dc5a8ddc/72abdf46-28de-4a4d-984b-fc8019b95247/images/015359d2-6992-45f0-aac7-63e0cad3f747.png)

**Step 5:** Review and accept the agent's changes as before. Once accepted, the **Quotas** panel at the top will display the generated tables

![](https://usercontent.in.prod.clueso.io/743138ba-7933-4a1a-90b2-26ddeb90ccbd/05bff956-b6b9-43fb-a3e7-da02dc5a8ddc/72abdf46-28de-4a4d-984b-fc8019b95247/images/b861d2c6-446b-4ad7-8a0d-87c484943c46.png)

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

***

### Inline Editing with the Widget

For quick, targeted edits you can use the inline widget.

**Step 6:** Hover over any line in the script. Two options appear:

* **Generate** (on an empty line) — asks the agent to write new code at that position.

  You'll also have the option to select the number of questions to generate at a time between 3, 5 and 10.

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

* **Edit** (incase a set of lines are selected) — asks the agent to modify the selected code. Type your request into the chat and the agent will propose changes inline.

![](https://usercontent.in.prod.clueso.io/743138ba-7933-4a1a-90b2-26ddeb90ccbd/05bff956-b6b9-43fb-a3e7-da02dc5a8ddc/72abdf46-28de-4a4d-984b-fc8019b95247/images/1b03a347-f3b6-4038-8796-4302e1dc9a3a.png)

**Step 7:** Review and **Accept** or **Reject** the inline changes, just like you would with chat-generated edits.

***

### Tips

* Use the **Design File** panel on the right as a reference while you prompt the agent — it shows your original questionnaire.
* Navigate between the **script**, **design file**, and **AI assistant** panels to cross-check your updates.
* Save a **checkpoint** before making large changes so you can roll back if needed.


---

# 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/survey-programming-dimensions/programming-with-ai.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.
