> 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-qualtrics/metaforms-chrome-extension-qualtrics-guide/prompting-and-workflow-best-practices-qualtrics.md).

# Prompting & Workflow Best Practices (Qualtrics)

Use these practices when you program surveys in Metaforms. Explicit, scoped instructions produce more accurate questions, reduce debugging, and shorten programming time.

These patterns come from real Metaforms projects.

#### Core principle: state the outcome and the constraints

Describe the result you want before generation starts. Name the questions in scope, the structure to follow, and what must stay unchanged.

| **Avoid**                                | **Prefer**                                  |
| ---------------------------------------- | ------------------------------------------- |
| Generate everything and fix errors later | Generate a small batch, then review it      |
| Short instructions                       | Explicit instructions                       |
| Debug after every generation             | Type the change in the prompt box           |
| Use the prompt box for a tiny fix        | Edit manually when a fix takes 5–10 seconds |
| Leave requirements implied               | State the constraints directly              |

#### Prompt examples

These examples are Qualtrics programming tasks you can paste into the prompt box. Each one names the questions, the Qualtrics behavior, and what must stay unchanged. Open a tab, then copy the prompt at the bottom.

{% tabs %}
{% tab title="Next questions" %}
Generate the next batch of questions exactly as written in the questionnaire.

**Constraints**

* Name the question range to generate.
* Add settings the questionnaire doesn't state, such as force response.

{% hint style="info" %}
**Focus**

Generate only the questions you name.
{% endhint %}

{% hint style="warning" %}
**Avoid**

Do not change questions that were already generated.
{% endhint %}

{% hint style="success" %}
**Prompt**

Generate Q12–Q14 from the questionnaire. Force response on all three.
{% endhint %}

{% hint style="info" %}
**Result**

Q12, Q13, and Q14 are added to the survey as written in the questionnaire. Respondents must answer each one before they can move on.
{% endhint %}
{% endtab %}

{% tab title="Fix a batch" %}
Correct the question type or validation on questions that are already in the survey.

**Constraints**

* Match each question type to the questionnaire.
* Keep the existing question text, numbering, and answer choices unless the prompt says to change them.

{% hint style="info" %}
**Focus**

Fix only the questions you name.
{% endhint %}

{% hint style="warning" %}
**Avoid**

Do not regenerate the questions or edit other blocks.
{% endhint %}

{% hint style="success" %}
**Prompt**

Update Q15–Q17 to a numeric list, as specified in the questionnaire. Apply numeric validation.
{% endhint %}

{% hint style="info" %}
**Result**

Q15–Q17 become numeric list questions. Respondents can enter only numbers in them.
{% endhint %}
{% endtab %}

{% tab title="Display logic" %}
Show or hide a question based on an earlier answer.

**Constraints**

* Add display logic only on the question you name.
* Keep the question text and answer choices unchanged.

{% hint style="info" %}
**Focus**

Set the display condition from the questionnaire.
{% endhint %}

{% hint style="warning" %}
**Avoid**

Do not add branch logic in Survey flow unless the prompt asks for it.
{% endhint %}

{% hint style="success" %}
**Prompt**

Add display logic so Q8 is shown only when Q7 is Yes. Do not change the question text or answer choices.
{% endhint %}

{% hint style="info" %}
**Result**

Respondents who answer Yes at Q7 see Q8. Everyone else skips it. Q8 itself looks the same as before.
{% endhint %}
{% endtab %}

{% tab title="Piped text" %}
Store an answer in embedded data and pipe it forward.

**Constraints**

* Use the embedded data field named in the prompt.
* Pipe from the source question only.
* Leave the visible question text and choices unchanged.

{% hint style="info" %}
**Focus**

Create the embedded data field and the pipe for that question.
{% endhint %}

{% hint style="warning" %}
**Avoid**

Do not change other embedded data fields or Survey flow blocks.
{% endhint %}

{% hint style="success" %}
**Prompt**

Generate S7b with hidden variable hS7bx1. Pipe the values from S7b into hS7bx1.
{% endhint %}

{% hint style="info" %}
**Result**

S7b is added along with a hidden variable, hS7bx1, that stores the S7b answers so later questions can use them. Respondents don't see hS7bx1.
{% endhint %}
{% endtab %}

{% tab title="Screener terminate" %}
End the survey for respondents who don't qualify. Metaforms adds a branch to Survey flow, right after the Screener block, with an End of Survey element inside it.

**Constraints**

* Name the screener questions and the answers that disqualify a respondent.
* Say where the branch goes in Survey flow.
* Say how the survey should end, for example as a screen-out.

{% hint style="info" %}
**Focus**

Add only the branch and the End of Survey element.
{% endhint %}

{% hint style="warning" %}
**Avoid**

Do not change the screener questions or the order of other blocks.
{% endhint %}

{% hint style="success" %}
**Prompt**

In Survey flow, add a branch right after the Screener block. If S1 is "Under 18" or S3 is "None of these", end the survey as a screen-out. Do not change the screener questions.
{% endhint %}

{% hint style="info" %}
**Result**

Respondents who pick "Under 18" at S1 or "None of these" at S3 leave the survey as a screen-out right after the Screener block. Everyone else carries on.
{% endhint %}
{% endtab %}

{% tab title="Instructions" %}
Format respondent instructions on questions that are already created.

**Constraints**

* Change only the respondent instructions.
* Keep question text, question type, and answer choices unchanged.

{% hint style="info" %}
**Focus**

Apply the formatting to each respondent instruction in the survey.
{% endhint %}

{% hint style="warning" %}
**Avoid**

Do not regenerate the questions.
{% endhint %}

{% hint style="success" %}
**Prompt**

Add () to the respondent instructions and add a br before each respondent instruction.
{% endhint %}

{% hint style="info" %}
**Result**

Every respondent instruction appears in brackets on its own line under the question, for example *(Mandatory to answer)*.
{% endhint %}
{% endtab %}

{% tab title="Loop" %}
Update questions that sit inside a loop.

**Constraints**

* Edit only the questions you name.
* Keep those questions inside the existing loop.

{% hint style="info" %}
**Focus**

Update Q21–Q23 where they already appear in the loop.
{% endhint %}

{% hint style="warning" %}
**Avoid**

Do not move the questions out of the loop or edit other loop fields.
{% endhint %}

{% hint style="success" %}
**Prompt**

Update Q21–Q23 inside the loop.
{% endhint %}

{% hint style="info" %}
**Result**

Q21–Q23 are updated where they sit in the loop and stay inside it. Other loop questions are unchanged.
{% endhint %}
{% endtab %}
{% endtabs %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.metaforms.ai/survey-programming-qualtrics/metaforms-chrome-extension-qualtrics-guide/prompting-and-workflow-best-practices-qualtrics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
