重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
sf-industry-commoncore-flexcard by jaganpro/sf-skills
npx skills add https://github.com/jaganpro/sf-skills --skill sf-industry-commoncore-flexcard专注于 Salesforce Industries 的 FlexCard UI 组件的 OmniStudio 专家工程师。生成生产就绪的 FlexCard 定义,通过声明式数据绑定、集成过程数据源、条件渲染和正确的 SLDS 样式,实现信息一目了然的显示。所有 FlexCard 都依据涵盖 7 个类别的 130 点评分标准 进行验证。
| 需求 | 文档 | 描述 |
|---|---|---|
| 最佳实践 | references/best-practices.md | 布局模式、SLDS、无障碍访问、性能 |
| 数据绑定 | references/data-binding-guide.md | IP 源、字段映射、条件渲染 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
FlexCard 位于 OmniStudio 技术栈的表示层。在构建依赖于上游组件的 FlexCard 之前,请确保这些上游组件已存在。
sf-industry-commoncore-omnistudio-analyze → sf-industry-commoncore-datamapper → sf-industry-commoncore-integration-procedure → sf-industry-commoncore-omniscript → sf-industry-commoncore-flexcard (您在此处)
FlexCard 使用来自集成过程的数据,并可以启动 OmniScript。请先构建数据层,再构建表示层。
| 见解 | 详情 |
|---|---|
| 配置字段 | OmniUiCard 使用 DataSourceConfig 进行数据源绑定,使用 PropertySetConfig 进行卡片布局、状态和操作配置。在 Core 命名空间中,OmniUiCard 上没有 Definition 字段。 |
| 数据源绑定 | 数据源绑定到集成过程以获取实时数据;在 FlexCard 可以检索数据之前,IP 必须处于活动状态且已部署 |
| 子卡片嵌入 | FlexCard 可以将其他 FlexCard 作为子卡片嵌入,从而实现具有共享或独立数据源的复合布局 |
| OmniScript 启动 | FlexCard 可以通过操作按钮启动 OmniScript,将卡片数据源中的上下文数据传递到 OmniScript 的输入中 |
| 设计器虚拟对象 | FlexCard 设计器使用 OmniFlexCardView 作为虚拟列表对象 (/lightning/o/OmniFlexCardView/home),与存储卡片记录的 OmniUiCard sObject 是分开的。通过 API 创建的卡片在打开设计器之前可能不会出现在“最近查看”列表中。 |
在构建之前,与相关方明确以下内容:
| 问题 | 重要性 |
|---|---|
| 卡片的用途是什么? | 决定布局类型和数据密度 |
| 需要哪些数据源? | 确定所需的集成过程 |
| 它在哪个对象上下文中运行? | 决定是记录级显示还是列表级显示 |
| 卡片应提供哪些操作? | 驱动按钮/链接配置和 OmniScript 集成 |
| 哪种布局最适合该用例? | 单卡、列表、选项卡式或弹出式 |
| 是否有条件显示规则? | 根据数据值显示/隐藏的字段或部分 |
| 布局类型 | 用例 | 描述 |
|---|---|---|
| 单卡 | 记录摘要 | 显示单个记录字段的一张卡片 |
| 卡片列表 | 相关记录 | 绑定到数组数据源的重复卡片 |
| 选项卡式卡片 | 多上下文 | 在一个卡片内以选项卡形式显示的多个状态 |
| 弹出式卡片 | 按需详情 | 从摘要卡片触发的可展开详情面板 |
每个 FlexCard 数据源都连接到一个集成过程(或其他源类型),并将响应字段映射到显示元素。
FlexCard → 数据源 (类型: IntegrationProcedure)
→ IP 名称 + 输入映射
→ 响应字段映射 → 卡片元素
{datasource.fieldName} 合并语法将 IP 响应字段映射到卡片显示元素{recordId})传递给 IP| 操作类型 | 目的 | 配置 |
|---|---|---|
| 启动 OmniScript | 启动引导式流程 | OmniScript 类型 + 子类型,传递上下文参数 |
| 导航 | 转到记录或 URL | 记录 ID 或带有合并字段的 URL 模板 |
| 自定义操作 | 平台事件、LWC 等 | 具有有效负载映射的自定义操作处理程序 |
OmniUiCard)针对多种数据场景测试每个 FlexCard:
| 场景 | 验证内容 |
|---|---|
| 有数据 | 所有字段正确渲染,合并字段解析正确 |
| 空数据 | 空状态消息显示,没有损坏的合并字段 |
| 错误状态 | 当 IP 返回错误或超时时,进行优雅处理 |
| 多记录 | 卡片列表渲染正确数量的项目,分页有效 |
| 操作按钮 | OmniScript 启动时带有正确的预填充数据 |
| 条件字段 | 可见性规则根据数据值正确切换 |
| 移动端 | 卡片布局适应较小的视口宽度 |
生成 FlexCard 定义时避免以下模式:
| 反模式 | 错误原因 | 正确方法 |
|---|---|---|
| 引用不存在的 IP 数据源 | 卡片在运行时无法加载数据 | 在绑定前验证 IP 存在且处于活动状态 |
| 样式中的硬编码颜色 | 破坏 SLDS 主题和深色模式 | 使用 SLDS 设计令牌和 CSS 自定义属性 |
| 缺少无障碍访问属性 | 不符合 WCAG 标准 | 添加 aria-label、role 和键盘处理程序 |
| 过度嵌套子卡片 | 深度嵌套导致性能下降 | 限制为 2 级嵌套;尽可能扁平化 |
| 忽略空状态 | 当数据源未返回记录时,UI 损坏 | 配置显式的空状态消息 |
| 硬编码记录 ID | 卡片在不同环境中损坏 | 使用合并字段和上下文驱动的参数 |
所有 FlexCard 都根据 7 个类别进行验证。阈值:✅ 90+ (可部署) | ⚠️ 67-89 (需审查) | ❌ <67 (阻止 - 需要修复)
| 类别 | 分数 | 标准 |
|---|---|---|
| 设计与布局 | 25 | 布局类型恰当,字段分组逻辑清晰,响应式设计,间距一致,视觉层次清晰 |
| 数据绑定 | 20 | IP 引用正确,合并字段语法正确,输入参数映射正确,多源协调良好 |
| 操作与导航 | 20 | 操作按钮配置正确,OmniScript 启动参数映射正确,导航目标有效,操作标签描述清晰 |
| 样式 | 20 | 使用 SLDS 令牌(无硬编码颜色),排版一致,正确使用卡片/磁贴模式,兼容深色模式 |
| 无障碍访问 | 15 | 交互元素上有 aria-label,操作可通过键盘导航,颜色对比度足够,屏幕阅读器友好的字段标签 |
| 测试 | 15 | 已通过有数据、空状态、错误状态、多记录场景和移动视口验证 |
| 性能 | 15 | 数据源调用最小化,子卡片嵌套有限(最多 2 级),无冗余 IP 调用,非可见状态使用懒加载 |
| 标准 | 分数 | 描述 |
|---|---|---|
| 布局类型与用例匹配 | 5 | 单卡、列表、选项卡式或弹出式选择恰当 |
| 字段分组逻辑清晰 | 5 | 相关字段在视觉上分组在一起 |
| 响应式行为 | 5 | 卡片适应不同的视口宽度 |
| 间距一致 | 5 | 边距和内边距遵循 SLDS 间距比例 |
| 视觉层次 | 5 | 主要信息突出,次要信息弱化 |
| 标准 | 分数 | 描述 |
|---|---|---|
| IP 引用有效 | 5 | 所有引用的 IP 都存在且处于活动状态 |
| 合并字段语法正确 | 5 | {datasource.field} 路径解析为实际的 IP 响应字段 |
| 输入参数映射正确 | 5 | 记录上下文正确传递到 IP 输入 |
| 多源协调良好 | 5 | 多个数据源按正确顺序加载,无冲突 |
| 标准 | 分数 | 描述 |
|---|---|---|
| 操作按钮功能正常 | 5 | 所有按钮都能触发其配置的操作 |
| OmniScript 参数映射正确 | 5 | 上下文数据正确流入启动的 OmniScript |
| 导航目标有效 | 5 | 记录和 URL 导航解析正确 |
| 标签描述清晰 | 5 | 操作标签清晰地传达操作内容 |
| 标准 | 分数 | 描述 |
|---|---|---|
| 使用 SLDS 令牌 | 5 | 颜色、字体、间距通过设计令牌设置 |
| 排版一致 | 5 | 文本大小遵循 SLDS 字体比例 |
| 符合卡片模式 | 5 | 使用标准的 SLDS 卡片或磁贴模式 |
| 兼容深色模式 | 5 | 无硬编码颜色;适用于 SLDS 深色主题 |
| 标准 | 分数 | 描述 |
|---|---|---|
| 交互元素有 ARIA 标签 | 5 | 按钮、链接和输入具有可访问的名称 |
| 可通过键盘导航 | 5 | 所有操作可通过 Tab 键访问,通过 Enter/Space 键激活 |
| 颜色对比度足够 | 5 | 符合 WCAG 2.1 AA 对比度比率(文本为 4.5:1) |
| 标准 | 分数 | 描述 |
|---|---|---|
| 已验证有数据 | 3 | 卡片在有完整数据时正确渲染 |
| 已验证空状态 | 3 | 空状态消息正确显示 |
| 已验证错误状态 | 3 | 对 IP 错误进行优雅处理 |
| 已验证多记录 | 3 | 卡片列表渲染正确的项目 |
| 已验证移动视口 | 3 | 布局适应小屏幕 |
| 标准 | 分数 | 描述 |
|---|---|---|
| 数据源调用最小化 | 5 | 无冗余或重复的 IP 调用 |
| 子卡片嵌套有限 | 5 | 最多 2 级嵌套子卡片 |
| 隐藏状态使用懒加载 | 5 | 非可见选项卡/弹出式按需加载 |
# 查询组织中的活动 FlexCard
sf data query -q "SELECT Id,Name,DataSourceConfig,PropertySetConfig,IsActive FROM OmniUiCard WHERE IsActive=true" -o <org>
# 按名称检索特定的 FlexCard
sf project retrieve start -m OmniUiCard:<Name> -o <org>
# 将 FlexCard 部署到目标组织
sf project deploy start -m OmniUiCard:<Name> -o <org>
# 检索所有 FlexCard
sf project retrieve start -m OmniUiCard -o <org>
# 部署所有 OmniStudio 元数据 (FlexCard + 依赖项)
sf project deploy start -m OmniUiCard -m OmniIntegrationProcedure -m OmniScript -o <org>
OmniUiCard 上的 DataSourceConfig 字段包含作为 JSON 的数据源绑定。PropertySetConfig 字段包含卡片布局、状态和字段定义。
重要:在 Core 命名空间中,
OmniUiCard上没有Definition字段。使用DataSourceConfig配置数据源,使用PropertySetConfig配置布局。
{
"dataSource": {
"type": "IntegrationProcedures",
"value": {
"ipMethod": "Type_SubType",
"vlocityAsync": false,
"inputMap": {
"recordId": "{recordId}"
},
"resultVar": ""
},
"orderBy": {
"name": "",
"isReverse": ""
},
"contextVariables": []
}
}
| 类型 | dataSource.type | 何时使用 |
|---|---|---|
| 集成过程 | IntegrationProcedures (复数,大写 P) | 主要模式;调用 IP 获取实时数据 |
| SOQL | SOQL | 直接查询(谨慎使用;建议使用 IP 进行抽象) |
| Apex Remote | ApexRemote | 自定义 Apex 类调用 |
| REST | REST | 通过命名凭证调用外部 API |
| 自定义 | Custom | 自定义数据提供程序(直接传递 JSON 主体) |
使用合并字段语法将 IP 响应字段映射到卡片显示元素:
IP 响应: FlexCard 合并字段:
───────────── ─────────────────────
{ "Name": "Acme Corp" } → {Name}
{ "Account": { → {Account.Name}
"Name": "Acme Corp"
}
}
{ "records": [ → {records[0].Name} (单个)
{ "Name": "Acme" } 或使用卡片列表布局进行迭代
]
}
将上下文从托管页面传递到 IP 数据源:
| 上下文变量 | 来源 | 示例 |
|---|---|---|
{recordId} | 当前记录页面 | 传递给 IP 以查询相关数据 |
{userId} | 运行用户 | 按当前用户筛选数据 |
{param.customKey} | URL 参数或父卡片 | 从父 FlexCard 或 URL 传递 |
| 技能 | 与 sf-industry-commoncore-flexcard 的关系 |
|---|---|
| sf-industry-commoncore-integration-procedure | 构建 FlexCard 使用的 IP 数据源 |
| sf-industry-commoncore-omniscript | 构建 FlexCard 操作按钮启动的 OmniScript |
| sf-industry-commoncore-datamapper | 构建 IP 在底层使用的 DataRaptor/DataMapper |
| sf-industry-commoncore-omnistudio-analyze | 分析跨 FlexCard、IP 和 OmniScript 的依赖链 |
| sf-deploy | 部署 FlexCard 元数据以及上游依赖项 |
| sf-lwc | 构建嵌入在 FlexCard 中的自定义 LWC 组件 |
| 场景 | 处理方法 |
|---|---|
| 空数据 | 配置显式的空状态并附带用户友好的消息;不要显示原始的“无数据”或空白卡片 |
| 错误状态 | 当 IP 数据源失败时,显示有意义的错误消息;记录错误以便调试 |
| 移动端响应性 | 移动端使用单列布局;避免水平滚动;在 320px 视口宽度下测试 |
| 长文本值 | 用省略号截断,并为完整文本提供弹出式或工具提示 |
| 大型记录集 | 使用带分页的卡片列表;将初始加载限制在 10-25 条记录 |
| 空字段值 | 使用条件可见性来隐藏值为空的字段,而不是显示空标签 |
| 混合数据新鲜度 | 当多个数据源具有不同的刷新率时,显示“最后更新”指示器 |
| 因素 | FlexCard | LWC |
|---|---|---|
| 构建方法 | 声明式(拖放) | 代码(JS、HTML、CSS) |
| 数据绑定 | 集成过程合并字段 | Wire 服务、Apex、GraphQL |
| 最适合 | 信息一目了然的显示 | 复杂的交互式 UI |
| 测试 | 手动 + 数据状态验证 | Jest 单元测试 + 手动 |
| 自定义 | 限于 OmniStudio 框架 | 完整的平台灵活性 |
| 重用 | 作为子卡片嵌入 | 作为子组件导入 |
| 何时选择 | 具有 IP 数据的标准卡片布局 | 自定义行为、动画、复杂状态 |
必需:具有 OmniStudio (Industries Cloud) 许可证的目标组织,已认证的 sf CLI 对于数据源:已部署到目标组织的活动集成过程 对于操作:已部署的活动 OmniScript(如果操作按钮启动 OmniScript) 评分:如果分数 < 67,则阻止部署
以编程方式创建 FlexCard:使用 REST API (sf api request rest --method POST --body @file.json)。必填字段:Name、VersionNumber、OmniUiCardType(例如 Child)。为数据源绑定设置 DataSourceConfig(JSON 字符串),为卡片布局设置 PropertySetConfig(JSON 字符串)。sf data create record --values 标志无法处理文本区域字段中的 JSON。创建后通过更新 IsActive=true 来激活。
MIT 许可证。版权所有 (c) 2026 David Ryan (weytani)
每周安装量
55
仓库
GitHub 星标
227
首次出现
8 天前
安全审计
安装于
cursor55
gemini-cli52
github-copilot52
amp52
cline52
codex52
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.
| Need | Document | Description |
|---|---|---|
| Best practices | references/best-practices.md | Layout patterns, SLDS, accessibility, performance |
| Data binding | references/data-binding-guide.md | IP sources, field mapping, conditional rendering |
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.
| Insight | Detail |
|---|---|
| Configuration fields | OmniUiCard 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 binding | Data sources bind to Integration Procedures for live data; the IP must be active and deployed before the FlexCard can retrieve data |
| Child card embedding | FlexCards can embed other FlexCards as child cards, enabling composite layouts with shared or independent data sources |
| OmniScript launching | FlexCards can launch OmniScripts via action buttons, passing context data from the card's data source into the OmniScript's input |
Before building, clarify these with the stakeholder:
| Question | Why 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 Type | Use Case | Description |
|---|---|---|
| Single Card | Record summary | One card displaying fields from a single record |
| Card List | Related records | Repeating cards bound to an array data source |
| Tabbed Card | Multi-context | Multiple states displayed as tabs within one card |
| Flyout Card | Detail on demand | Expandable detail panel triggered from a summary card |
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
{datasource.fieldName} merge syntax{recordId}) to the IP| Action Type | Purpose | Configuration |
|---|---|---|
| Launch OmniScript | Start a guided process | OmniScript Type + SubType, pass context params |
| Navigate | Go to record or URL | Record ID or URL template with merge fields |
| Custom Action | Platform event, LWC, etc. | Custom action handler with payload mapping |
OmniUiCard)Test each FlexCard against multiple data scenarios:
| Scenario | What to Verify |
|---|---|
| Populated data | All fields render correctly, merge fields resolve |
| Empty data | Empty-state message displays, no broken merge fields |
| Error state | Graceful handling when IP returns an error or times out |
| Multi-record | Card list renders correct number of items, pagination works |
| Action buttons | OmniScript launches with correct pre-populated data |
| Conditional fields | Visibility rules toggle correctly based on data values |
| Mobile | Card layout adapts to smaller viewport widths |
Avoid these patterns when generating FlexCard definitions:
| Anti-Pattern | Why It's Wrong | Correct Approach |
|---|---|---|
| Referencing non-existent IP data sources | Card fails to load data at runtime | Verify IP exists and is active before binding |
| Hardcoded colors in styles | Breaks SLDS theming and dark mode | Use SLDS design tokens and CSS custom properties |
| Missing accessibility attributes | Fails WCAG compliance | Add aria-label, role, and keyboard handlers |
| Excessive nested child cards | Performance degrades with deep nesting | Limit to 2 levels of nesting; flatten where possible |
| Ignoring empty states | Broken UI when data source returns no records | Configure explicit empty-state messaging |
| Hardcoded record IDs | Card breaks across environments | Use merge fields and context-driven parameters |
All FlexCards are validated against 7 categories. Thresholds : ✅ 90+ (Deploy) | ⚠️ 67-89 (Review) | ❌ <67 (Block - fix required)
| Category | Points | Criteria |
|---|---|---|
| Design & Layout | 25 | Appropriate layout type, logical field grouping, responsive design, consistent spacing, clear visual hierarchy |
| Data Binding | 20 | Correct IP references, proper merge field syntax, input parameter mapping, multi-source coordination |
| Actions & Navigation | 20 | Action buttons configured correctly, OmniScript launch params mapped, navigation targets valid, action labels descriptive |
| Styling | 20 | SLDS tokens used (no hardcoded colors), consistent typography, proper use of card/tile patterns, dark mode compatible |
| Accessibility | 15 | aria-label on interactive elements, keyboard navigable actions, sufficient color contrast, screen reader friendly field labels |
| Testing | 15 |
| Criterion | Points | Description |
|---|---|---|
| Layout type matches use case | 5 | Single, list, tabbed, or flyout chosen appropriately |
| Field grouping is logical | 5 | Related fields are visually grouped together |
| Responsive behavior | 5 | Card adapts to different viewport widths |
| Consistent spacing | 5 | Margins and padding follow SLDS spacing scale |
| Visual hierarchy | 5 | Primary information is prominent, secondary is de-emphasized |
| Criterion | Points | Description |
|---|---|---|
| IP references are valid | 5 | All referenced IPs exist and are active |
| Merge field syntax correct | 5 | {datasource.field} paths resolve to actual IP response fields |
| Input parameters mapped | 5 | Record context passed correctly to IP inputs |
| Multi-source coordination | 5 | Multiple data sources load in correct order without conflicts |
| Criterion | Points | Description |
|---|---|---|
| Action buttons functional | 5 | All buttons trigger their configured actions |
| OmniScript params mapped | 5 | Context data flows correctly into launched OmniScripts |
| Navigation targets valid | 5 | Record and URL navigation resolves correctly |
| Labels are descriptive | 5 | Action labels clearly communicate what the action does |
| Criterion | Points | Description |
|---|---|---|
| SLDS tokens used | 5 | Colors, fonts, spacing via design tokens |
| Consistent typography | 5 | Text sizes follow SLDS type scale |
| Card pattern compliance | 5 | Uses standard SLDS card or tile patterns |
| Dark mode compatible | 5 | No hardcoded colors; works with SLDS dark theme |
| Criterion | Points | Description |
|---|---|---|
| ARIA labels on interactive elements | 5 | Buttons, links, and inputs have accessible names |
| Keyboard navigable | 5 | All actions reachable via Tab, activated via Enter/Space |
| Color contrast sufficient | 5 | Meets WCAG 2.1 AA contrast ratio (4.5:1 for text) |
| Criterion | Points | Description |
|---|---|---|
| Populated data verified | 3 | Card renders correctly with full data |
| Empty state verified | 3 | Empty-state message displays properly |
| Error state verified | 3 | Graceful handling of IP errors |
| Multi-record verified | 3 | Card list renders correct items |
| Mobile viewport verified | 3 | Layout adapts to small screens |
| Criterion | Points | Description |
|---|---|---|
| Data source calls minimized | 5 | No redundant or duplicate IP invocations |
| Child card nesting limited | 5 | Maximum 2 levels of nested child cards |
| Lazy loading for hidden states | 5 | Non-visible tabs/flyouts load on demand |
# 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>
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
Definitionfield onOmniUiCardin Core namespace. UseDataSourceConfigfor data sources andPropertySetConfigfor layout.
{
"dataSource": {
"type": "IntegrationProcedures",
"value": {
"ipMethod": "Type_SubType",
"vlocityAsync": false,
"inputMap": {
"recordId": "{recordId}"
},
"resultVar": ""
},
"orderBy": {
"name": "",
"isReverse": ""
},
"contextVariables": []
}
}
| Type | dataSource.type | When to Use |
|---|---|---|
| Integration Procedure | IntegrationProcedures (plural, capital P) | Primary pattern; calls an IP for live data |
| SOQL | SOQL | Direct query (use sparingly; prefer IP for abstraction) |
| Apex Remote | ApexRemote | Custom Apex class invocation |
| REST | REST |
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
]
}
Pass context from the hosting page into the IP data source:
| Context Variable | Source | Example |
|---|---|---|
{recordId} | Current record page | Pass to IP to query related data |
{userId} | Running user | Filter data by current user |
{param.customKey} | URL parameter or parent card | Pass from parent FlexCard or URL |
| Skill | Relationship to sf-industry-commoncore-flexcard |
|---|---|
| sf-industry-commoncore-integration-procedure | Build the IP data sources that FlexCards consume |
| sf-industry-commoncore-omniscript | Build the OmniScripts that FlexCard action buttons launch |
| sf-industry-commoncore-datamapper | Build DataRaptors/DataMappers that IPs use under the hood |
| sf-industry-commoncore-omnistudio-analyze | Analyze dependency chains across FlexCards, IPs, and OmniScripts |
| sf-deploy | Deploy FlexCard metadata along with upstream dependencies |
| sf-lwc | Build custom LWC components embedded within FlexCards |
| Scenario | Handling |
|---|---|
| Empty data | Configure an explicit empty-state with a user-friendly message; do not show raw "No data" or blank card |
| Error states | Display a meaningful error message when the IP data source fails; log the error for debugging |
| Mobile responsiveness | Use single-column layout for mobile; avoid horizontal scrolling; test at 320px viewport width |
| Long text values | Truncate with ellipsis and provide a flyout or tooltip for full text |
| Large record sets | Use card list with pagination; limit initial load to 10-25 records |
| Null field values | Use conditional visibility to hide fields with null values rather than showing empty labels |
| Mixed data freshness | When multiple data sources have different refresh rates, display a "last updated" indicator |
| Factor | FlexCard | LWC |
|---|---|---|
| Build method | Declarative (drag-and-drop) | Code (JS, HTML, CSS) |
| Data binding | Integration Procedure merge fields | Wire service, Apex, GraphQL |
| Best for | At-a-glance information display | Complex interactive UIs |
| Testing | Manual + data state verification | Jest unit tests + manual |
| Customization | Limited to OmniStudio framework | Full platform flexibility |
| Reuse | Embed as child cards | Import as child components |
| When to choose | Standard card layouts with IP data | Custom behavior, animations, complex state |
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.
MIT License. Copyright (c) 2026 David Ryan (weytani)
Weekly Installs
55
Repository
GitHub Stars
227
First Seen
8 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
cursor55
gemini-cli52
github-copilot52
amp52
cline52
codex52
React视图过渡API使用指南:实现原生浏览器动画与状态管理
8,400 周安装
Cloudflare Tunnel Access 认证指南:使用服务令牌进行API调用与自动化请求
111 周安装
技能进化管理器:AI技能自动优化与版本控制工具
110 周安装
Camofox Browser - 反检测浏览器自动化工具,C++级指纹欺骗,绕过机器人检测
109 周安装
NeMo Curator - NVIDIA GPU 加速的大语言模型数据整理工具包,去重快16倍
112 周安装
Rocket.net API 集成指南:WordPress 托管平台 API 开发与站点管理
109 周安装
tuzi-comic 知识漫画生成器:AI 驱动,灵活画风与基调组合创作原创漫画
109 周安装
| Designer virtual object | The 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. |
| Verified with populated data, empty state, error state, multi-record scenario, and mobile viewport |
| Performance | 15 | Data source calls minimized, child card nesting limited (max 2 levels), no redundant IP calls, lazy loading for non-visible states |
| External API call via Named Credential |
| Custom | Custom | Custom data provider (pass JSON body directly) |