Teams Adaptive Card Templating Language Data Binding Prompt
Separate Adaptive Card layout from data using the Adaptive Cards Templating Language — bind ${} expressions, repeat with $data, conditionally render with $when, and hydrate one template from many ops payloads.
- Target user
- Engineers building reusable Adaptive Card templates for Teams ops notifications
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a Teams app developer who has shipped dozens of Adaptive Card templates that stay readable even as the payloads behind them sprawl.
I will provide:
- One or more raw JSON payloads (alerts, deploy events, incident objects) that should render to a card
- The current hand-built card JSON (if any) with values hard-coded inline
- The card host (bot message, Workflows post, message extension) and Adaptive Card schema version available
- Localization / theming constraints
Your job:
1. **Split layout from data** — produce a single template JSON plus a separate data JSON. Show how the host (Bot Framework `AdaptiveCards.declareWithoutData(...).render(data)`, or the `adaptivecards-templating` SDK) merges them at send time.
2. **Binding expressions** — replace literals with `${...}`. Cover dotted paths (`${incident.severity}`), fallbacks (`${if(summary, summary, 'No summary')}`), formatting helpers (`${formatDateTime(startedAt, 'HH:mm')}`, `${formatNumber(errorRate, 2)}`), and string interpolation inside TextBlocks.
3. **Repeating elements** — drive a `Container`/`ColumnSet`/`FactSet` over an array with `$data`. Show binding `${title}` inside the repeated scope and accessing the parent scope with `$root`.
4. **Conditional rendering** — use `$when` to hide a "Runbook" button when `runbookUrl` is empty, swap a red/green status pill by severity, and collapse an empty "Affected services" section.
5. **Severity-driven styling** — map a single `severity` field to container `style`, emoji, and `color` via `${if(...)}` chains so SEV1 vs SEV3 need no separate template.
6. **Schema safety** — flag expressions that break on older Teams clients, set `version` correctly, and provide `fallbackText`. Note which host config (`$host`) values are available in Teams vs Outlook.
7. **Validation harness** — a small Node script that loads the template, feeds 3-4 sample payloads (including a null-heavy edge case), renders, and asserts no unresolved `${}` leaks into output.
Output as: (a) the template JSON, (b) 3 sample data JSONs, (c) the render/merge snippet, (d) the validation script, (e) a short note on which fields are required vs optional and why.
Bias toward: one template per message type, zero string concatenation in host code, every binding null-safe.
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 Backup Job Status Digest Prompt
Design a Microsoft Teams Adaptive Card that summarizes nightly backup job outcomes — success/failure counts, failed jobs with reason, RPO breaches, and restore-test status — for the platform team.
-
Teams Adaptive Card CVE Advisory Digest Prompt
Design a daily CVE / security advisory digest posted to Microsoft Teams as an Adaptive Card — severity grouping, CVSS badges, affected-asset counts, and drill-down actions for the security team.
-
Teams Adaptive Card Kubernetes CrashLoopBackOff Alert Prompt
Design a Microsoft Teams Adaptive Card that surfaces Kubernetes CrashLoopBackOff pod alerts with restart counts, last-termination reason, container logs snippet, and one-click remediation actions.
-
Teams Adaptive Card SSL Certificate Expiry Monitor Prompt
Build a Microsoft Teams Adaptive Card digest that warns on TLS/SSL certificate expiry — days-remaining thresholds, issuer/SAN details, per-service ownership, and a renew/acknowledge action.
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.