Skip to content
SalesforceSkills

FlexCards

Build FlexCards for Health, Financial Services, and other Industries clouds. AI writes the component structure from your description.

Skill Details

Install this skill

Versionv1.0.0AuthorDavid Ryan (weytani)LicenseMITSections15

Works with

Claude CodeCursorWindsurf

Expert OmniStudio engineer specializing in FlexCard UI components for Salesforce Industries. Generate production-ready FlexCard definitions that display at-a-glance information with declarative data binding, Integration Procedure data sources, conditional rendering, and proper SLDS styling. All FlexCards are validated against a 130-point scoring rubric across 7 categories.

Core Responsibilities

1
FlexCard Authoring: Design and build FlexCard definitions with proper layout, states, and field mappings
2
Data Source Binding: Configure Integration Procedure data sources with correct field mapping and error handling
3
Test Generation: Validate cards against multiple data states (populated, empty, error, multi-record)
4
Documentation: Produce deployment-ready documentation with data source lineage and action mappings

Document Map

CRITICAL: Orchestration Order

FlexCards sit at the presentation layer of the OmniStudio stack. Ensure upstream components exist before building a FlexCard that depends on them.

sf-industry-commoncore-omnistudio-analyze → sf-industry-commoncore-datamapper → sf-industry-commoncore-integration-procedure → sf-industry-commoncore-omniscript → sf-industry-commoncore-flexcard (you are here)

FlexCards consume data from Integration Procedures and can launch OmniScripts. Build the data layer first, then the presentation layer.

Key Insights

Workflow (5-Phase Pattern)Workflow

Phase 1: Requirements Gathering

Before building, clarify these with the stakeholder:

Phase 2: Design & Layout

#### Card Layout Options

#### Data Source Configuration

Each FlexCard data source connects to an Integration Procedure (or other source type) and maps response fields to display elements.

FlexCard → Data Source (type: IntegrationProcedure)
         → IP Name + Input Mapping
         → Response Field Mapping → Card Elements
  • Map IP response fields to card display elements using {datasource.fieldName} merge syntax
  • Configure input parameters to pass record context (e.g., {recordId}) to the IP
  • Set data source order when multiple sources feed the same card

#### Action Button Design

#### Conditional Visibility

  • Show/hide fields based on data values using visibility conditions
  • Show/hide entire card states based on data source results
  • Display empty-state messaging when data source returns no records

Phase 3: Generation & Validation

1
Generate the FlexCard definition JSON
2
Validate all data source references resolve to active Integration Procedures
3
Run the 130-point scoring rubric (see Scoring section below)
4
Verify merge field syntax matches IP response structure
5
Check accessibility attributes on all interactive elements

Phase 4: Deployment

1
Ensure all upstream Integration Procedures are deployed and active
2
Deploy the FlexCard metadata (OmniUiCard)
3
Activate the FlexCard in the target org
4
Embed the FlexCard in the target Lightning page, OmniScript, or parent FlexCard

Phase 5: Testing

Test each FlexCard against multiple data scenarios:

Generation Guardrails

Avoid these patterns when generating FlexCard definitions:

Scoring Rubric (130 Points)Reference

All FlexCards are validated against 7 categories. Thresholds: ✅ 90+ (Deploy) | ⚠️ 67-89 (Review) | ❌ <67 (Block - fix required)

Scoring Breakdown Detail

#### Design & Layout (25 points)

#### Data Binding (20 points)

#### Actions & Navigation (20 points)

#### Styling (20 points)

#### Accessibility (15 points)

#### Testing (15 points)

#### Performance (15 points)

CLI Commands

Terminal
# Query active FlexCards in the org
sf data query -q "SELECT Id,Name,DataSourceConfig,PropertySetConfig,IsActive FROM OmniUiCard WHERE IsActive=true" -o <org>

# Retrieve a specific FlexCard by name
sf project retrieve start -m OmniUiCard:<Name> -o <org>

# Deploy a FlexCard to the target org
sf project deploy start -m OmniUiCard:<Name> -o <org>

# Retrieve all FlexCards
sf project retrieve start -m OmniUiCard -o <org>

# Deploy all OmniStudio metadata (FlexCards + dependencies)
sf project deploy start -m OmniUiCard -m OmniIntegrationProcedure -m OmniScript -o <org>

Data Source Binding

FlexCard Data Source Configuration

The DataSourceConfig field on OmniUiCard contains the data source bindings as JSON. The PropertySetConfig field contains the card layout, states, and field definitions.

IMPORTANT: There is NO Definition field on OmniUiCard in Core namespace. Use DataSourceConfig for data sources and PropertySetConfig for layout.
JSON
{
  "dataSource": {
    "type": "IntegrationProcedures",
    "value": {
      "ipMethod": "Type_SubType",
      "vlocityAsync": false,
      "inputMap": {
        "recordId": "{recordId}"
      },
      "resultVar": ""
    },
    "orderBy": {
      "name": "",
      "isReverse": ""
    },
    "contextVariables": []
  }
}

Data Source Types

Field Mapping from IP Response

Map IP response fields to card display elements using merge field syntax:

IP Response:                    FlexCard Merge Field:
─────────────                   ─────────────────────
{ "Name": "Acme Corp" }   →    {Name}
{ "Account": {            →    {Account.Name}
    "Name": "Acme Corp"
  }
}
{ "records": [             →    {records[0].Name}  (single)
    { "Name": "Acme" }          or iterate with Card List layout
  ]
}

Input Parameter Mapping

Pass context from the hosting page into the IP data source:

Cross-Skill IntegrationReference

Edge Cases

FlexCard vs LWC Decision Guide

NeedDocumentDescription
Best practicesreferences/best-practices.mdLayout patterns, SLDS, accessibility, performance
Data bindingreferences/data-binding-guide.mdIP sources, field mapping, conditional rendering
InsightDetail
Configuration fieldsOmniUiCard uses DataSourceConfig for data source bindings and PropertySetConfig for card layout, states, and actions. There is NO Definition field on OmniUiCard in Core namespace.
Data source bindingData sources bind to Integration Procedures for live data; the IP must be active and deployed before the FlexCard can retrieve data
Child card embeddingFlexCards can embed other FlexCards as child cards, enabling composite layouts with shared or independent data sources
OmniScript launchingFlexCards can launch OmniScripts via action buttons, passing context data from the card's data source into the OmniScript's input
Designer virtual objectThe FlexCard Designer uses OmniFlexCardView as a virtual list object (/lightning/o/OmniFlexCardView/home), separate from the OmniUiCard sObject where card records are stored. Cards created via API may not appear in "Recently Viewed" until opened in the Designer.
QuestionWhy It Matters
What is the card's purpose?Determines layout type and data density
Which data sources are needed?Identifies required Integration Procedures
What object context does it run in?Determines record-level vs. list-level display
What actions should the card expose?Drives button/link configuration and OmniScript integration
What layout best fits the use case?Single card, list, tabbed, or flyout
Are there conditional display rules?Fields or sections that appear/hide based on data values
Layout TypeUse CaseDescription
Single CardRecord summaryOne card displaying fields from a single record
Card ListRelated recordsRepeating cards bound to an array data source
Tabbed CardMulti-contextMultiple states displayed as tabs within one card
Flyout CardDetail on demandExpandable detail panel triggered from a summary card
Action TypePurposeConfiguration
Launch OmniScriptStart a guided processOmniScript Type + SubType, pass context params
NavigateGo to record or URLRecord ID or URL template with merge fields
Custom ActionPlatform event, LWC, etc.Custom action handler with payload mapping
ScenarioWhat to Verify
Populated dataAll fields render correctly, merge fields resolve
Empty dataEmpty-state message displays, no broken merge fields
Error stateGraceful handling when IP returns an error or times out
Multi-recordCard list renders correct number of items, pagination works
Action buttonsOmniScript launches with correct pre-populated data
Conditional fieldsVisibility rules toggle correctly based on data values
MobileCard layout adapts to smaller viewport widths
Anti-PatternWhy It's WrongCorrect Approach
Referencing non-existent IP data sourcesCard fails to load data at runtimeVerify IP exists and is active before binding
Hardcoded colors in stylesBreaks SLDS theming and dark modeUse SLDS design tokens and CSS custom properties
Missing accessibility attributesFails WCAG complianceAdd aria-label, role, and keyboard handlers
Excessive nested child cardsPerformance degrades with deep nestingLimit to 2 levels of nesting; flatten where possible
Ignoring empty statesBroken UI when data source returns no recordsConfigure explicit empty-state messaging
Hardcoded record IDsCard breaks across environmentsUse merge fields and context-driven parameters
CategoryPointsCriteria
Design & Layout25Appropriate layout type, logical field grouping, responsive design, consistent spacing, clear visual hierarchy
Data Binding20Correct IP references, proper merge field syntax, input parameter mapping, multi-source coordination
Actions & Navigation20Action buttons configured correctly, OmniScript launch params mapped, navigation targets valid, action labels descriptive
Styling20SLDS tokens used (no hardcoded colors), consistent typography, proper use of card/tile patterns, dark mode compatible
Accessibility15aria-label on interactive elements, keyboard navigable actions, sufficient color contrast, screen reader friendly field labels
Testing15Verified with populated data, empty state, error state, multi-record scenario, and mobile viewport
Performance15Data source calls minimized, child card nesting limited (max 2 levels), no redundant IP calls, lazy loading for non-visible states
CriterionPointsDescription
Layout type matches use case5Single, list, tabbed, or flyout chosen appropriately
Field grouping is logical5Related fields are visually grouped together
Responsive behavior5Card adapts to different viewport widths
Consistent spacing5Margins and padding follow SLDS spacing scale
Visual hierarchy5Primary information is prominent, secondary is de-emphasized
CriterionPointsDescription
IP references are valid5All referenced IPs exist and are active
Merge field syntax correct5{datasource.field} paths resolve to actual IP response fields
Input parameters mapped5Record context passed correctly to IP inputs
Multi-source coordination5Multiple data sources load in correct order without conflicts
CriterionPointsDescription
Action buttons functional5All buttons trigger their configured actions
OmniScript params mapped5Context data flows correctly into launched OmniScripts
Navigation targets valid5Record and URL navigation resolves correctly
Labels are descriptive5Action labels clearly communicate what the action does
CriterionPointsDescription
SLDS tokens used5Colors, fonts, spacing via design tokens
Consistent typography5Text sizes follow SLDS type scale
Card pattern compliance5Uses standard SLDS card or tile patterns
Dark mode compatible5No hardcoded colors; works with SLDS dark theme
CriterionPointsDescription
ARIA labels on interactive elements5Buttons, links, and inputs have accessible names
Keyboard navigable5All actions reachable via Tab, activated via Enter/Space
Color contrast sufficient5Meets WCAG 2.1 AA contrast ratio (4.5:1 for text)
CriterionPointsDescription
Populated data verified3Card renders correctly with full data
Empty state verified3Empty-state message displays properly
Error state verified3Graceful handling of IP errors
Multi-record verified3Card list renders correct items
Mobile viewport verified3Layout adapts to small screens
CriterionPointsDescription
Data source calls minimized5No redundant or duplicate IP invocations
Child card nesting limited5Maximum 2 levels of nested child cards
Lazy loading for hidden states5Non-visible tabs/flyouts load on demand
TypedataSource.typeWhen to Use
Integration ProcedureIntegrationProcedures (plural, capital P)Primary pattern; calls an IP for live data
SOQLSOQLDirect query (use sparingly; prefer IP for abstraction)
Apex RemoteApexRemoteCustom Apex class invocation
RESTRESTExternal API call via Named Credential
CustomCustomCustom data provider (pass JSON body directly)
Context VariableSourceExample
{recordId}Current record pagePass to IP to query related data
{userId}Running userFilter data by current user
{param.customKey}URL parameter or parent cardPass from parent FlexCard or URL
SkillRelationship to sf-industry-commoncore-flexcard
sf-industry-commoncore-integration-procedureBuild the IP data sources that FlexCards consume
sf-industry-commoncore-omniscriptBuild the OmniScripts that FlexCard action buttons launch
sf-industry-commoncore-datamapperBuild DataRaptors/DataMappers that IPs use under the hood
sf-industry-commoncore-omnistudio-analyzeAnalyze dependency chains across FlexCards, IPs, and OmniScripts
sf-deployDeploy FlexCard metadata along with upstream dependencies
sf-lwcBuild custom LWC components embedded within FlexCards
ScenarioHandling
Empty dataConfigure an explicit empty-state with a user-friendly message; do not show raw "No data" or blank card
Error statesDisplay a meaningful error message when the IP data source fails; log the error for debugging
Mobile responsivenessUse single-column layout for mobile; avoid horizontal scrolling; test at 320px viewport width
Long text valuesTruncate with ellipsis and provide a flyout or tooltip for full text
Large record setsUse card list with pagination; limit initial load to 10-25 records
Null field valuesUse conditional visibility to hide fields with null values rather than showing empty labels
Mixed data freshnessWhen multiple data sources have different refresh rates, display a "last updated" indicator
FactorFlexCardLWC
Build methodDeclarative (drag-and-drop)Code (JS, HTML, CSS)
Data bindingIntegration Procedure merge fieldsWire service, Apex, GraphQL
Best forAt-a-glance information displayComplex interactive UIs
TestingManual + data state verificationJest unit tests + manual
CustomizationLimited to OmniStudio frameworkFull platform flexibility
ReuseEmbed as child cardsImport as child components
When to chooseStandard card layouts with IP dataCustom behavior, animations, complex state

DependenciesReference

Required: Target org with OmniStudio (Industries Cloud) license, sf CLI authenticated

For Data Sources: Active Integration Procedures deployed to the target org

For Actions: Active OmniScripts deployed (if action buttons launch OmniScripts)

Scoring: Block deployment if score < 67

Creating FlexCards programmatically: Use REST API (sf api request rest --method POST --body @file.json). Required fields: Name, VersionNumber, OmniUiCardType (e.g., Child). Set DataSourceConfig (JSON string) for data source bindings and PropertySetConfig (JSON string) for card layout. The sf data create record --values flag cannot handle JSON in textarea fields. Activate by updating IsActive=true after creation.

External References

License

MIT License.

Copyright (c) 2026 David Ryan (weytani)

Navigate Industries