add_display_logic
Add Display Logic to a question, or to the submit screen — the "Display the question only, If..." / "Display the submit button only, If..." conditions in the builder's Logic tab. This is NOT Jump/Skip Logic (that's add_jump_logic — controls where the respondent goes next, never whether something is shown) and NOT Answer Logic (that's add_answer_logic — controls one specific answer choice, not the whole question/button). The only outcome here is visibility: the target is shown when the condition(s) match, hidden otherwise — nothing else happens. Identify the TARGET (the thing that will be shown/hidden) with questionId or position, OR pass submitScreen: true to target the submit button instead (displayLogics[survey.submit.id] — same map, same rules, just a different target; exactly one of questionId/position/submitScreen). Omit entryIndex to create the target's first "if" block; provide entryIndex: 0 (from get_display_logic) to append the given condition(s) to it instead, combined via each condition's own conidition. Both a question and the submit screen can only ever have ONE entry — confirmed for both directly in the builder source, no "add another" affordance either way — so omitting entryIndex when one already exists is refused outright (no force override; there's nothing legitimate to force through), pointing you at entryIndex: 0 instead. Use insertAfterConditionIndex to control WHERE a condition lands within an existing entry (omit to append at the end). This is additive, not destructive — no confirmation needed beyond that one refusal. Creating a QUESTION's first entry also auto-disables Question Randomization if it was on (matches the builder's own side effect) — check randomizationDisabled in the result and mention it to the user if true; this never happens for the submit screen (confirmed: its own "Add Display Logic" click has no such side effect), and never happens when appending to an existing entry either way. Question/submit-level Display Logic ONLY — does not cover Answer Logic (that's add_answer_logic) or thank-you-screen display logic (that's add_thankyou_screen_logic). The call is refused outright (no force override, nothing added) if a condition's source question comes after the target question in the survey — its answer wouldn't exist yet at that point, so the condition can never be satisfied, not just risky (this never applies to a submit target, since submit always comes after every question). Reorder the questions (reorder_questions) or pick an earlier source question first, then retry.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"surveyId": "<surveyId>",
"conditions": "<conditions>"
},
"name": "add_display_logic"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamId | No | Which team workspace to act in (ids come from get_account_info or list_surveys). Optional: if omitted, the server uses the team that owns the given surveyId, or your only team. Required for create_survey when you belong to several teams. | |
| position | No | 0-based position of the target question. Provide this OR questionId OR submitScreen. | |
| surveyId | Yes | The Survey ID containing the question | |
| conditions | Yes | One or more conditions to add — to a new entry, or appended to entryIndex's existing entry. | |
| entryIndex | No | Existing display-logic entry index to append condition(s) to — always 0, since a question or the submit screen can only ever have one entry each. Omit only to create that first entry; if one already exists, omitting this is refused (a second entry would be silently inert, not an alternate rule). | |
| questionId | No | The TARGET question's id — the question that will be shown/hidden. Provide this OR position OR submitScreen. | |
| submitScreen | No | true to target the submit screen's Display Logic instead of a question — controls whether the submit button shows. Mutually exclusive with questionId/position. | |
| insertAfterConditionIndex | No | Only used together with `entryIndex` (appending to an existing entry): where the new condition(s) land within that entry's condition list. -1 inserts at the very start, N inserts right after condition N. Omit to append at the end (the default). Ignored when creating the first entry. |