PranavNagrecha/AwesomeSalesforceSkills / skills/admin/flexcard-requirements
flexcard-requirements
VerifiedSpecify a FlexCard before a developer opens Card Designer: the card-state set and the condition that selects each state, the data source type behind each card (DataRaptor, Integration Procedure, Apex remote, SOQL), the action menu users get (navigate, launch OmniScript, Apex, DataRaptor), and every embedded child FlexCard or custom LWC. Produces the artifacts a BA hands to the builder. Trigger keywords: FlexCard requirements, FlexCard BA, FlexCard layout design, FlexCard data sources, FlexCard actions, FlexCard card states, OmniStudio FlexCard scoping. NOT for building the card in Card Designer, NOT for OmniScript step and branching requirements (use admin/omniscript-flow-design-requirements), NOT for standard Lightning record-page component requirements.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 13.1 KB |
| references/examples.md | markdown | 6.0 KB |
| references/gotchas.md | markdown | 6.5 KB |
| references/llm-anti-patterns.md | markdown | 9.1 KB |
| references/metadata-examples.md | markdown | 4.4 KB |
| references/well-architected.md | markdown | 5.0 KB |
| scripts/check_flexcard_requirements.pyexecutable | script | 5.0 KB |
| templates/flexcard-requirements-template.md | markdown | 2.0 KB |
references/examples.md
View on GitHub# Examples — FlexCard Requirements
## Example 1: Patient Summary FlexCard for Health Cloud Service Console
**Context:** A healthcare org uses Health Cloud. Service agents need a Patient Summary FlexCard on the patient record page showing key health data, recent encounters, and a button to launch a new encounter OmniScript.
**Problem:** The BA produces a generic card wireframe without specifying data source types. The developer defaults to SOQL for all fields, but several fields (EncounterCount, LastCareGapStatus) come from an Integration Procedure that aggregates Care Observation records. The card shows blank values for those fields with no error message.
**Solution:**
Requirements document specifies a data source mapping matrix:
- Patient Name, DOB, MRN: SOQL (Patient/Account object direct fields)
- LastEncounterDate, EncounterCount: Integration Procedure (`GetPatientSummaryIP`) — aggregated from ClinicalEncounter records (a standard Health Cloud object)
- ActiveCarePlans: Integration Procedure (`GetPatientSummaryIP`) — filtered CarePlan list
- LastCareGapStatus: Integration Procedure (`GetPatientSummaryIP`) — derived field
Action requirements:
- "New Encounter" button: OmniScript Launch action, Type=NewEncounterOmniScript, SubType=Intake, opens in modal, passes PatientId from FlexCard context
Card states: Two states — Active Patient (`Status == 'Active'`, full layout) and Inactive Patient (`Status != 'Active'`, reduced layout showing Name, DOB, MRN only with "Inactive" badge)
**Why it works:** The data source matrix prevents the developer from defaulting to SOQL for IP-required fields. The card states are documented with condition expressions so the developer can wire them directly without a design discovery session.
---
## Example 2: Order Status FlexCard for B2B Commerce Service Console
**Context:** A B2B Commerce org needs a FlexCard on the Order record page showing order status, line items, and an action to initiate a return via an OmniScript.
**Problem:** Requirements don't specify how many card states are needed or what the conditions are. The developer builds a single-state card. Later, stakeholders request a different layout for Cancelled orders. A new state template must be added, requiring reactivation during business hours and a brief outage.
**Solution:**
Requirements document specifies three card states upfront:
- Active Order: `OrderStatus__c IN ('Draft', 'Activated', 'InFulfillment')` — full layout with line items and Return action button
- Completed Order: `OrderStatus__c == 'Completed'` — read-only layout, no action buttons, shows Delivered date
- Cancelled Order: `OrderStatus__c == 'Cancelled'` — read-only layout with "Cancelled" badge, shows Cancellation reason
Build dependency noted: Child FlexCard `OrderLineItemCard` must be activated before parent `OrderStatusCard` can be activated.
**Why it works:** Documenting all card states upfront prevents mid-project state template additions that require reactivation. The child card build dependency ensures the build sequence is planned.
---
## Anti-Pattern: Treating FlexCard Requirements as Standard Report/Dashboard Requirements
**What practitioners do:** They produce a standard "dashboard widget" specification listing data fields and chart types — without specifying data source type, action type, or card state conditions.
**What goes wrong:** The developer cannot build the card without knowing whether the data comes from SOQL, DataRaptor, or Integration Procedure. The developer makes arbitrary choices, often defaulting to SOQL, which fails for aggregated or external API data. Action buttons are added without specifying the action type, leading to Navigation actions being used where OmniScript Launch is required.
**Correct approach:** Use a FlexCard-specific requirements template that specifies: data source type per field, action type per button/trigger, card state conditions, and embedded component build dependencies.
---
## Example 3: The Requirements Package as a Structured Artifact
**Context:** The Patient Summary card from Example 1 will also appear, read-only, on an authenticated patient portal. The developer asks for one file that covers both placements.
**Solution:** Capture the requirements as YAML in the project repository:
```yaml
card: PatientSummaryCard
omnistudio_runtime: standard # OmniAnalytics tracking objects exist only in OmniStudio Standard
placements:
- context: service_console_record_page
audience: care_coordinators
- context: experience_cloud_authenticated
audience: patients # read-only; no actions rendered in this state
data_sources:
- fields: [Name, BirthDate, MRN]
source: data_mapper
name: DM_PatientDemographics
- fields: [LastEncounterDate, EncounterCount, ActiveCarePlans, LastCareGapStatus]
source: integration_procedure # multi-object aggregation
name: IP_GetPatientSummary
states:
- name: ActivePatient
condition: "Status == 'Active'"
order: 1
- name: InactivePatient
condition: "Status != 'Active'"
order: 2
actions:
- label: New Encounter
type: omniscript_launch
target: { type: NewEncounter, subtype: Intake }
passes: [PatientId]
audiences: [care_coordinators]
needs: [read Account, create ClinicalEncounter]
embedded_components: []
permissions:
care_coordinators: Patient_Summary_Card_Coordinator # permission set in metadata-examples.md
patients: portal sharing on own records; no edit access
analytics:
tracking_group: Patient_Cards # OmniTrackingGroup, API 60.0
deployment_rule: "Cards move only through OmniStudio deployment tooling; never edit OmniUiCard records with data tools"
```
**Why it works:** Every placement has an audience, every field group has a source, and every action names the access it needs, so the developer can build and test each audience without a discovery session. UNVERIFIED (2026-10-03): the `type` and `subtype` keys for an OmniScript launch follow common OmniStudio usage and are not documented in the guides read; match them to the org's Card Designer.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |