Teams Adaptive Card Input Validation & Conditional Visibility Prompt
Build Adaptive Cards with client-side input validation, required-field enforcement, and toggleable conditional visibility so ops forms guide users without round-tripping to the bot.
- Target user
- Developers designing data-entry Adaptive Cards for Teams ops workflows
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are an Adaptive Cards specialist who builds ops intake forms that are impossible to submit wrong. I will provide: - The fields my form needs (text, choices, dates, numbers) and which are required - Cross-field rules (e.g., "if Severity = SEV1, Pager field becomes required") - The host (Teams desktop/web/mobile) and the Adaptive Card schema version I target - How the card is delivered (bot, message extension, Workflows) Your job: 1. **Schema-version reality check** — confirm which features (`Input.validation`, `isRequired`, `regex`, `errorMessage`, `Action.ToggleVisibility`, `valueChangedAction`) are supported at my target version in Teams specifically, and call out where Teams lags the spec. 2. **Per-input validation** — for each `Input.*`, add `isRequired`, `errorMessage`, and `regex`/`min`/`max` where applicable. Show the exact JSON, including a phone/email/ticket-id regex example. 3. **Conditional visibility** — implement the cross-field rules using `targetElements` + `Action.ToggleVisibility`, and where supported, `Input.Toggle` with `valueChangedAction` to auto-reveal dependent fields. Provide a fallback for hosts that don't support auto-toggle. 4. **Submit gating** — explain how `Action.Submit` triggers validation, what happens to invalid inputs, and how to set `associatedInputs: auto` vs `none` so a "Cancel" action doesn't fire validation. 5. **Server-side defense** — make clear that client validation is UX only; provide the bot-side re-validation of the `Action.Submit` payload, since a crafted activity can bypass the card UI entirely. 6. **Accessibility & mobile** — label/placeholder guidance, tab order, and how toggled-hidden elements behave for screen readers and on the mobile renderer. 7. **Test cases** — empty required field, regex mismatch, conditional field shown-then-hidden, and a forged payload with the hidden field populated. Output as: (a) the full Adaptive Card JSON with validation and toggles, (b) the bot-side validation function, (c) a host-support compatibility table, (d) a list of the test cases with expected results. Bias toward: never trusting the client, graceful degradation on mobile, minimal taps to submit.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Teams Adaptive Card Linter and Pre-Send Validator Prompt
Audit and lint an Adaptive Card JSON before it ships through Microsoft Teams — catching schema-version violations, unsupported elements, broken templating, and render failures across hosts.
-
Adaptive Card Optimistic UI for Long-Running Actions Prompt
Design an Adaptive Card pattern that shows immediate optimistic feedback (disabled buttons, in-progress state, fallback timeout copy) while a slow backend action runs, so responders never double-click a deploy or approval.
-
Bot Card Update vs New Message Strategy for Channel Noise Prompt
Decide, per ChatOps interaction, whether a Teams bot should update an existing activity in place or post a new message — keeping incident channels readable instead of drowning responders in a wall of bot cards.
-
Teams Adaptive Card Form Designer for Runbook Inputs Prompt
Design Adaptive Card forms for runbook inputs in Teams — typed inputs, validation, conditional visibility, multi-step flows, and submission via Action.Execute to your bot service.
More Microsoft Teams prompts & error guides
Browse every Microsoft Teams prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.