building-omnistudio-omniscript
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesebuilding-omnistudio-omniscript: OmniStudio OmniScript Creation and Validation
building-omnistudio-omniscript:OmniStudio OmniScript 创建与验证
Expert OmniStudio OmniScript builder for declarative, step-based guided digital experiences. OmniScripts are the OmniStudio analog of Screen Flows: multi-step, interactive processes that collect input, orchestrate server-side logic (Integration Procedures, DataRaptors), and present results to the user — all without code.
专业的OmniStudio OmniScript构建工具,用于声明式、基于步骤的引导式数字体验。OmniScript相当于OmniStudio中的Screen Flows:无需代码即可实现多步骤交互式流程,收集输入信息、编排服务器端逻辑(Integration Procedures、DataRaptors)并向用户展示结果。
Quick Reference
快速参考
Scoring: 120 points across 6 categories. Thresholds: ✅ 90+ (Deploy) | ⚠️ 67-89 (Review) | ❌ <67 (Block - fix required)
评分体系:6大类共120分。阈值标准:✅ 90分及以上(可部署) | ⚠️ 67-89分(需审核) | ❌ 低于67分(需修复,禁止部署)
Scope
适用范围
- In scope: Creating OmniScripts from requirements, element selection and PropertySetConfig design, dependency analysis (Integration Procedures, DataRaptors), data flow tracing, 120-point validation scoring, deployment and activation
- Out of scope: Building FlexCards (use ), creating Integration Procedures directly (use
building-omnistudio-flexcard), mapping full dependency trees (usebuilding-omnistudio-integration-procedure), deploying metadata to org (useanalyzing-omnistudio-dependencies)deploying-metadata
- 包含场景:根据需求创建OmniScript、元素选择与PropertySetConfig设计、依赖分析(Integration Procedures、DataRaptors)、数据流追踪、120分验证评分、部署与激活
- 排除场景:构建FlexCards(请使用)、直接创建Integration Procedures(请使用
building-omnistudio-flexcard)、映射完整依赖树(请使用building-omnistudio-integration-procedure)、将元数据部署到组织(请使用analyzing-omnistudio-dependencies)deploying-metadata
Required Inputs
必需输入项
Gather these before building:
| Input | Description | Default |
|---|---|---|
| Type | Process category (e.g., | None — required |
| SubType | Specific variation (e.g., | None — required |
| Language | Locale for the OmniScript | |
| Purpose | Business process this OmniScript guides | None — required |
| Target org | Org alias for deployment | Current default org |
| Data sources | Objects/APIs to query or update | Identify from requirements |
构建前需收集以下信息:
| 输入项 | 描述 | 默认值 |
|---|---|---|
| Type | 流程类别(例如 | 必填,无默认值 |
| SubType | 具体变体(例如 | 必填,无默认值 |
| Language | OmniScript的区域语言 | |
| Purpose | 该OmniScript所引导的业务流程 | 必填,无默认值 |
| Target org | 部署目标组织的别名 | 当前默认组织 |
| Data sources | 需查询或更新的对象/API | 根据需求确定 |
Core Responsibilities
核心职责
- OmniScript Generation: Create well-structured OmniScripts from requirements, selecting appropriate element types for each step
- Element Design: Configure PropertySetConfig JSON for each element with correct data binding, validation, and conditional logic
- Dependency Analysis: Map all references to Integration Procedures, DataRaptors, and embedded OmniScripts before deployment
- Data Flow Analysis: Trace data through the OmniScript JSON structure — from prefill through user input to final save actions
- OmniScript生成:根据需求创建结构规范的OmniScript,为每个步骤选择合适的元素类型
- 元素设计:为每个元素配置PropertySetConfig JSON,确保数据绑定、验证规则和条件逻辑正确
- 依赖分析:部署前映射所有对Integration Procedures、DataRaptors和嵌入式OmniScript的引用
- 数据流分析:追踪数据在OmniScript JSON结构中的流转——从预填充、用户输入到最终保存操作
CRITICAL: Orchestration Order
关键注意事项:编排顺序
analyzing-omnistudio-dependencies → building-omnistudio-datamapper → building-omnistudio-integration-procedure → building-omnistudio-omniscript → building-omnistudio-flexcard (you are here: building-omnistudio-omniscript)
OmniScripts consume Integration Procedures and DataRaptors. Build those FIRST. FlexCards may launch OmniScripts — build FlexCards AFTER. Use analyzing-omnistudio-dependencies to map the full dependency tree before starting.
analyzing-omnistudio-dependencies → building-omnistudio-datamapper → building-omnistudio-integration-procedure → building-omnistudio-omniscript → building-omnistudio-flexcard(当前处于:building-omnistudio-omniscript)
OmniScript依赖Integration Procedures和DataRaptors,需优先构建这些组件。FlexCards可能会启动OmniScript,需在OmniScript之后构建。开始前请使用analyzing-omnistudio-dependencies映射完整的依赖树。
Key Insights
关键要点
| Insight | Details |
|---|---|
| Type/SubType/Language triplet | Uniquely identifies an OmniScript. All three values are required and form the composite key. Example: Type= |
| PropertySetConfig | JSON blob containing all element configuration — layout, data binding, validation rules, conditional visibility. This is where the real logic lives |
| Core namespace | OmniProcess with |
| Element hierarchy | Elements use Level/Order fields for tree structure. Level 0 = Steps, Level 1+ = elements within steps. Order determines sequence within a level |
| Version management | Multiple versions can exist; only one can be active per Type/SubType/Language triplet. Activate via the |
| Data JSON | OmniScripts pass a single JSON data structure through all steps. Elements read from and write to this shared JSON via merge field syntax |
| 要点 | 详情 |
|---|---|
| Type/SubType/Language三元组 | 唯一标识一个OmniScript。三个值均为必填项,共同构成复合键。示例:Type= |
| PropertySetConfig | 包含所有元素配置的JSON对象——布局、数据绑定、验证规则、条件可见性。核心逻辑均在此处定义 |
| 核心命名空间 | OmniProcess的 |
| 元素层级 | 元素通过Level/Order字段构建树形结构。Level 0 = 步骤,Level 1+ = 步骤内的元素。Order字段决定同层级元素的顺序 |
| 版本管理 | 可存在多个版本,但每个Type/SubType/Language三元组只能有一个激活版本。通过 |
| Data JSON | OmniScript在所有步骤中传递单一JSON数据结构。元素通过合并字段语法读取和写入该共享JSON |
Workflow Design (5-Phase Pattern)
工作流设计(5阶段模式)
Phase 1: Requirements Gathering
阶段1:需求收集
Before building, evaluate alternatives: OmniScripts are best for complex, multi-step guided processes. For simple single-screen data entry, consider Screen Flows. For data display without interaction, consider FlexCards.
Ask the user to gather:
- Type: The process category (e.g., ,
ServiceRequest,Enrollment)ClaimSubmission - SubType: The specific variation (e.g., ,
NewCase,UpdateAddress)FileAppeal - Language: Typically unless multi-language support is required
English - Purpose: What business process this OmniScript guides the user through
- Target org: Org alias for deployment
- Data sources: Which objects/APIs need to be queried or updated
Then: Check existing OmniScripts to avoid duplication, identify reusable Integration Procedures or DataRaptors, and map the dependency chain.
构建前评估替代方案:OmniScript最适用于复杂的多步骤引导流程。对于简单的单屏数据录入,可考虑使用Screen Flows;对于无需交互的数据展示,可考虑使用FlexCards。
请用户收集以下信息:
- Type:流程类别(例如、
ServiceRequest、Enrollment)ClaimSubmission - SubType:具体变体(例如、
NewCase、UpdateAddress)FileAppeal - Language:通常为,除非需要多语言支持
English - Purpose:该OmniScript引导用户完成的业务流程
- Target org:部署目标组织的别名
- Data sources:需查询或更新的对象/API
后续操作:检查现有OmniScript避免重复,识别可复用的Integration Procedures或DataRaptors,并映射依赖链。
Phase 2: Design & Element Selection
阶段2:设计与元素选择
Design each step and select element types appropriate to the interaction pattern.
设计每个步骤,并根据交互模式选择合适的元素类型。
Container Elements
容器元素
| Element Type | Purpose | Key Config |
|---|---|---|
| Step | Top-level container for a group of UI elements; each Step is a page in the wizard | |
| Conditional Block | Show/hide a group of elements based on conditions | |
| Loop Block | Iterate over a data list and render elements for each item | |
| Edit Block | Inline editing container for tabular data | |
| 元素类型 | 用途 | 关键配置 |
|---|---|---|
| Step | 一组UI元素的顶级容器;每个Step对应向导中的一个页面 | |
| Conditional Block | 根据条件显示/隐藏一组元素 | |
| Loop Block | 遍历数据列表并为每个项渲染元素 | |
| Edit Block | 表格数据的内联编辑容器 | |
Input Elements
输入元素
| Element Type | Purpose | Key Config |
|---|---|---|
| Text | Single-line text input | |
| Text Area | Multi-line text input | |
| Number | Numeric input with optional formatting | |
| Date | Date picker | |
| Date/Time | Date and time picker | |
| Checkbox | Boolean toggle | |
| Radio | Radio button group for single selection | |
| Select | Dropdown selection | |
| Multi-select | Multiple item selection | |
| Type Ahead | Search/autocomplete input | |
| Signature | Signature capture pad | |
| File | File upload | |
| Currency | Currency input with locale formatting | |
| Email input with format validation | | |
| Telephone | Phone number input with masking | |
| URL | URL input with format validation | |
| Password | Masked text input | |
| Range | Slider input | |
| Time | Time picker | |
| 元素类型 | 用途 | 关键配置 |
|---|---|---|
| Text | 单行文本输入 | |
| Text Area | 多行文本输入 | |
| Number | 带可选格式的数值输入 | |
| Date | 日期选择器 | |
| Date/Time | 日期时间选择器 | |
| Checkbox | 布尔值切换按钮 | |
| Radio | 单选按钮组 | |
| Select | 下拉选择框 | |
| Multi-select | 多选选择框 | |
| Type Ahead | 搜索/自动补全输入框 | |
| Signature | 签名捕获面板 | |
| File | 文件上传 | |
| Currency | 带区域格式的货币输入 | |
| 带格式验证的邮箱输入 | | |
| Telephone | 带掩码的电话号码输入 | |
| URL | 带格式验证的URL输入 | |
| Password | 掩码文本输入 | |
| Range | 滑块输入 | |
| Time | 时间选择器 | |
Display Elements
展示元素
| Element Type | Purpose | Key Config |
|---|---|---|
| Text Block | Static content display (HTML supported) | |
| Headline | Section heading | |
| Aggregate | Calculated summary display | |
| Disclosure | Expandable/collapsible content | |
| Image | Image display | |
| Chart | Data visualization | |
| 元素类型 | 用途 | 关键配置 |
|---|---|---|
| Text Block | 静态内容展示(支持HTML) | |
| Headline | 章节标题 | |
| Aggregate | 计算结果汇总展示 | |
| Disclosure | 可展开/折叠内容 | |
| Image | 图片展示 | |
| Chart | 数据可视化图表 | |
Action Elements
动作元素
| Element Type | Purpose | Key Config |
|---|---|---|
| DataRaptor Extract Action | Pull data from Salesforce | |
| DataRaptor Load Action | Push data to Salesforce | |
| Integration Procedure Action | Call server-side Integration Procedure | |
| Remote Action | Call Apex @RemoteAction or REST | |
| Navigate Action | Page navigation or redirection | |
| DocuSign Envelope Action | Trigger DocuSign envelope | |
| Email Action | Send email | |
| 元素类型 | 用途 | 关键配置 |
|---|---|---|
| DataRaptor Extract Action | 从Salesforce拉取数据 | |
| DataRaptor Load Action | 向Salesforce推送数据 | |
| Integration Procedure Action | 调用服务器端Integration Procedure | |
| Remote Action | 调用Apex @RemoteAction或REST接口 | |
| Navigate Action | 页面导航或重定向 | |
| DocuSign Envelope Action | 触发DocuSign信封 | |
| Email Action | 发送邮件 | |
Logic Elements
逻辑元素
| Element Type | Purpose | Key Config |
|---|---|---|
| Set Values | Variable assignment and data transformation | |
| Validation | Input validation rules with custom messages | |
| Formula | Calculate values using formula expressions | |
| Submit Action | Final submission of collected data | |
| 元素类型 | 用途 | 关键配置 |
|---|---|---|
| Set Values | 变量赋值与数据转换 | |
| Validation | 带自定义提示的输入验证规则 | |
| Formula | 使用公式表达式计算值 | |
| Submit Action | 收集数据的最终提交 | |
Phase 3: Generation & Validation
阶段3:生成与验证
Run to verify no duplicate Type/SubType/Language exists.
scripts/check-duplicate-omniscript.sh <Type> <SubType> <Language> <org>Build the OmniScript:
- Create the OmniProcess record with Type, SubType, Language, and OmniProcessType='OmniScript'
- Create OmniProcessElement child records for each Step (Level=0)
- Create OmniProcessElement child records for each element within Steps (Level=1+, ordered by Order field)
- Configure PropertySetConfig JSON for each element
- Wire action elements to their Integration Procedures / DataRaptors
Validation (STRICT MODE):
- BLOCK: Missing Type/SubType/Language, circular OmniScript embedding, broken IP/DataRaptor references, missing required PropertySetConfig fields
- WARN: Steps with no elements, input elements without validation, missing error handling on actions, unused data paths, deeply nested elements (>4 levels)
Validation Report Format (6-Category Scoring 0-120):
Score: 102/120 ---- Very Good
-- Design & Structure: 22/25 (88%)
-- Data Integration: 18/20 (90%)
-- Error Handling: 17/20 (85%)
-- Performance: 18/20 (90%)
-- User Experience: 17/20 (85%)
-- Security: 10/15 (67%)运行验证是否存在重复的Type/SubType/Language组合。
scripts/check-duplicate-omniscript.sh <Type> <SubType> <Language> <org>构建OmniScript:
- 创建OmniProcess记录,设置Type、SubType、Language,且OmniProcessType='OmniScript'
- 为每个Step创建OmniProcessElement子记录(Level=0)
- 为Step内的每个元素创建OmniProcessElement子记录(Level=1+,按Order字段排序)
- 为每个元素配置PropertySetConfig JSON
- 将动作元素与对应的Integration Procedures / DataRaptors关联
验证(严格模式):
- 禁止部署:缺失Type/SubType/Language、OmniScript循环嵌入、IP/DataRaptor引用失效、PropertySetConfig必填字段缺失
- 警告:无元素的Step、未配置验证的输入元素、动作元素缺失错误处理、未使用的数据路径、嵌套过深的元素(超过4层)
验证报告格式(6大类评分,总分0-120):
Score: 102/120 ---- Very Good
-- Design & Structure: 22/25 (88%)
-- Data Integration: 18/20 (90%)
-- Error Handling: 17/20 (85%)
-- Performance: 18/20 (90%)
-- User Experience: 17/20 (85%)
-- Security: 10/15 (67%)Phase 4: Deployment
阶段4:部署
- Prerequisites: Verify org auth (). Confirm all referenced DataRaptors and Integration Procedures are active in the target org.
sf org display -o <org> - Deploy all dependencies first: DataRaptors, Integration Procedures, referenced OmniScripts.
- Run — this deploys the OmniScript and verifies activation. If deployment fails, the script outputs recovery instructions (deactivate and delete the partial record, then retry).
scripts/deploy-omniscript.sh <Name> <Type> <SubType> <org> - Activate the OmniScript version after successful deployment if not auto-activated.
- 前置条件:验证组织授权()。确认所有引用的DataRaptors和Integration Procedures在目标组织中已激活。
sf org display -o <org> - 优先部署所有依赖项:DataRaptors、Integration Procedures、引用的OmniScripts。
- 运行——该脚本将部署OmniScript并验证激活状态。若部署失败,脚本会输出恢复说明(停用并删除部分记录,然后重试)。
scripts/deploy-omniscript.sh <Name> <Type> <SubType> <org> - 部署成功后,若未自动激活,则手动激活OmniScript版本。
Phase 5: Testing
阶段5:测试
Walk through all paths with various data scenarios:
- Happy path: Complete all steps with valid data, verify submission
- Validation testing: Submit invalid data at each input, verify error messages
- Conditional testing: Exercise all conditional blocks and verify show/hide logic
- Data prefill: Verify DataRaptor Extract Actions populate elements correctly
- Save for later: Test resume functionality if enabled
- Navigation: Test back/forward/cancel behavior across all steps
- Error scenarios: Simulate IP/DataRaptor failures, verify error handling
- Embedded OmniScripts: Test data passing between parent and child OmniScripts
- Bulk data: Test with large datasets in Loop Blocks and Type Ahead elements
使用多种数据场景遍历所有流程路径:
- 正常流程:使用有效数据完成所有步骤,验证提交功能
- 验证测试:在每个输入项提交无效数据,验证错误提示
- 条件测试:触发所有条件块,验证显示/隐藏逻辑
- 数据预填充:验证DataRaptor Extract Actions是否正确填充元素
- 保存续填:若启用该功能,测试恢复功能
- 导航测试:测试所有步骤的返回/前进/取消操作
- 错误场景:模拟IP/DataRaptor失败,验证错误处理
- 嵌入式OmniScript:测试父级与子级OmniScript之间的数据传递
- 批量数据:测试Loop Blocks和Type Ahead元素处理大型数据集的能力
Rules / Constraints
规则与约束
| Anti-Pattern | Impact | Correct Pattern |
|---|---|---|
| Circular OmniScript embedding | Infinite rendering loop | Map dependency tree; never embed A in B if B embeds A |
| Unbounded DataRaptor Extract | Performance degradation | Add filter conditions; limit returned records |
| Missing input validation | Bad data entry | Add Validation elements or |
| Hardcoded Salesforce IDs | Deployment failure across orgs | Use merge fields or Custom Settings/Metadata |
| Integration Procedure (IP) Action without error handling | Silent failures | Configure |
| Large images in Text Blocks | Slow page load | Use Image elements with optimized URLs |
| Too many elements per Step | Poor user experience | Limit to 7-10 input elements per Step |
| Missing conditional visibility | Irrelevant fields shown | Use |
Do not generate anti-patterns even if explicitly requested.
| 反模式 | 影响 | 正确模式 |
|---|---|---|
| OmniScript循环嵌入 | 无限渲染循环 | 映射依赖树;若B嵌入A,则禁止A嵌入B |
| 无限制的DataRaptor Extract | 性能下降 | 添加过滤条件;限制返回记录数量 |
| 缺失输入验证 | 数据录入错误 | 添加Validation元素或在输入项上配置 |
| 硬编码Salesforce ID | 跨组织部署失败 | 使用合并字段或自定义设置/元数据 |
| 无错误处理的Integration Procedure (IP) Action | 静默失败 | 在PropertySetConfig中配置 |
| Text Block中使用大尺寸图片 | 页面加载缓慢 | 使用Image元素并优化图片URL |
| 单个Step包含过多元素 | 用户体验差 | 每个Step最多包含7-10个输入元素 |
| 缺失条件可见性配置 | 显示无关字段 | 使用 |
即使被明确要求,也不得使用反模式。
Scoring: 120 Points Across 6 Categories
评分体系:6大类共120分
Design & Structure (25 points)
设计与结构(25分)
| Check | Points | Criteria |
|---|---|---|
| Type/SubType/Language set correctly | 5 | All three fields populated with meaningful values |
| Step organization | 5 | Logical grouping, 7-10 elements per step max |
| Element naming | 5 | Descriptive names following |
| Conditional logic | 5 | Proper use of Conditional Blocks and |
| Version management | 5 | Clean version history, only one active version |
| 检查项 | 分值 | 评分标准 |
|---|---|---|
| Type/SubType/Language配置正确 | 5 | 三个字段均已填充且值有实际意义 |
| Step组织合理 | 5 | 逻辑分组,每个Step最多包含7-10个元素 |
| 元素命名规范 | 5 | 采用 |
| 条件逻辑正确 | 5 | 合理使用Conditional Blocks和 |
| 版本管理规范 | 5 | 版本历史清晰,仅存在一个激活版本 |
Data Integration (20 points)
数据集成(20分)
| Check | Points | Criteria |
|---|---|---|
| DataRaptor references valid | 5 | All Extract/Load bundles exist and are active |
| Integration Procedure references valid | 5 | All IP actions reference active IPs |
| Input/Output maps correct | 5 | Data flows correctly between elements and actions |
| Data prefill configured | 5 | Initial data loaded before user interaction |
| 检查项 | 分值 | 评分标准 |
|---|---|---|
| DataRaptor引用有效 | 5 | 所有Extract/Load包均存在且已激活 |
| Integration Procedure引用有效 | 5 | 所有IP动作均引用已激活的IP |
| 输入/输出映射正确 | 5 | 数据在元素与动作间流转正确 |
| 数据预填充配置完成 | 5 | 用户交互前已加载初始数据 |
Error Handling (20 points)
错误处理(20分)
| Check | Points | Criteria |
|---|---|---|
| Action elements have error handling | 5 | |
| User-facing error messages | 5 | Clear, actionable error text |
| Validation on required inputs | 5 | All required fields have validation rules |
| Fallback behavior defined | 5 | Graceful handling when data sources return empty |
| 检查项 | 分值 | 评分标准 |
|---|---|---|
| 动作元素配置错误处理 | 5 | 所有IP/DR动作均配置 |
| 用户友好的错误提示 | 5 | 错误文本清晰、可操作 |
| 必填输入项配置验证 | 5 | 所有必填字段均有验证规则 |
| 定义回退行为 | 5 | 数据源返回空值时可优雅处理 |
Performance (20 points)
性能(20分)
| Check | Points | Criteria |
|---|---|---|
| No unbounded data fetches | 5 | All DataRaptor Extracts have filters/limits |
| Lazy loading configured | 5 | Action elements fire on step entry, not OmniScript load |
| Element count per Step reasonable | 5 | No Step with >15 elements |
| Conditional rendering used | 5 | Elements hidden when not applicable (not just invisible) |
| 检查项 | 分值 | 评分标准 |
|---|---|---|
| 无无限制数据获取 | 5 | 所有DataRaptor Extract均配置过滤/限制条件 |
| 配置懒加载 | 5 | 动作元素在Step进入时触发,而非OmniScript加载时 |
| 单个Step元素数量合理 | 5 | 无Step包含超过15个元素 |
| 使用条件渲染 | 5 | 不适用的元素被隐藏(而非仅不可见) |
User Experience (20 points)
用户体验(20分)
| Check | Points | Criteria |
|---|---|---|
| Logical step flow | 5 | Steps follow natural task progression |
| Input labels and help text | 5 | All inputs have clear labels and contextual help |
| Navigation controls | 5 | Back, Next, Cancel, Save for Later configured appropriately |
| Responsive layout | 5 | Elements configured for mobile and desktop breakpoints |
| 检查项 | 分值 | 评分标准 |
|---|---|---|
| 步骤流程逻辑合理 | 5 | 步骤遵循自然任务流程 |
| 输入标签与帮助文本完善 | 5 | 所有输入项均有清晰标签和上下文帮助 |
| 导航控件配置合理 | 5 | 返回、下一步、取消、保存续填等控件配置得当 |
| 响应式布局 | 5 | 元素适配移动端和桌面端断点 |
Security (15 points)
安全性(15分)
| Check | Points | Criteria |
|---|---|---|
| No sensitive data in client-side JSON | 5 | Passwords, SSNs, tokens kept server-side |
| IP actions use server-side processing | 5 | Sensitive logic in Integration Procedures, not client OmniScript |
| Field-level access respected | 5 | Data access matches user profile/permission set |
| 检查项 | 分值 | 评分标准 |
|---|---|---|
| 客户端JSON无敏感数据 | 5 | 密码、社保号、令牌等数据保留在服务器端 |
| IP动作使用服务器端处理 | 5 | 敏感逻辑在Integration Procedures中实现,而非客户端OmniScript |
| 尊重字段级访问权限 | 5 | 数据访问权限与用户配置文件/权限集匹配 |
CLI Commands
CLI命令
See for the full command reference. Common commands:
scripts/cli-reference.shbash
undefined完整命令参考请查看。常用命令:
scripts/cli-reference.shbash
undefinedList active OmniScripts
列出已激活的OmniScript
sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE IsActive=true AND OmniProcessType='OmniScript' LIMIT 50" -o <org>
sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE IsActive=true AND OmniProcessType='OmniScript' LIMIT 50" -o <org>
Query elements for a specific OmniScript
查询特定OmniScript的元素
sf data query -q "SELECT Id,Name,ElementType,Level,Order FROM OmniProcessElement WHERE OmniProcessId='<id>' ORDER BY Level,Order LIMIT 200" -o <org>
sf data query -q "SELECT Id,Name,ElementType,Level,Order FROM OmniProcessElement WHERE OmniProcessId='<id>' ORDER BY Level,Order LIMIT 200" -o <org>
Check OmniScript versions
检查OmniScript版本
sf data query -q "SELECT Id,VersionNumber,IsActive,LastModifiedDate FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND OmniProcessType='OmniScript' ORDER BY VersionNumber DESC LIMIT 10" -o <org>
---sf data query -q "SELECT Id,VersionNumber,IsActive,LastModifiedDate FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND OmniProcessType='OmniScript' ORDER BY VersionNumber DESC LIMIT 10" -o <org>
---Cross-Skill Integration
跨技能集成
| From Skill | To building-omnistudio-omniscript | When |
|---|---|---|
| analyzing-omnistudio-dependencies | -> building-omnistudio-omniscript | "Analyze dependencies before building OmniScript" |
| building-omnistudio-datamapper | -> building-omnistudio-omniscript | "DataRaptor ready, build the OmniScript that uses it" |
| building-omnistudio-integration-procedure | -> building-omnistudio-omniscript | "IP ready, wire it into the OmniScript action" |
| From building-omnistudio-omniscript | To Skill | When |
|---|---|---|
| building-omnistudio-omniscript | -> building-omnistudio-flexcard | "Build FlexCard that launches this OmniScript" |
| building-omnistudio-omniscript | -> deploying-metadata | "Deploy OmniScript to target org" |
| building-omnistudio-omniscript | -> analyzing-omnistudio-dependencies | "Map full dependency tree before deployment" |
| building-omnistudio-omniscript | -> building-omnistudio-integration-procedure | "Need a new IP for this OmniScript action" |
| building-omnistudio-omniscript | -> building-omnistudio-datamapper | "Need a DataRaptor for data prefill" |
| 来源技能 | 目标技能:building-omnistudio-omniscript | 触发时机 |
|---|---|---|
| analyzing-omnistudio-dependencies | -> building-omnistudio-omniscript | "构建OmniScript前分析依赖关系" |
| building-omnistudio-datamapper | -> building-omnistudio-omniscript | "DataRaptor已就绪,构建使用它的OmniScript" |
| building-omnistudio-integration-procedure | -> building-omnistudio-omniscript | "IP已就绪,将其关联到OmniScript动作" |
| 来源技能:building-omnistudio-omniscript | 目标技能 | 触发时机 |
|---|---|---|
| building-omnistudio-omniscript | -> building-omnistudio-flexcard | "构建启动该OmniScript的FlexCard" |
| building-omnistudio-omniscript | -> deploying-metadata | "将OmniScript部署到目标组织" |
| building-omnistudio-omniscript | -> analyzing-omnistudio-dependencies | "部署前映射完整依赖树" |
| building-omnistudio-omniscript | -> building-omnistudio-integration-procedure | "该OmniScript动作需要新的IP" |
| building-omnistudio-omniscript | -> building-omnistudio-datamapper | "需要DataRaptor进行数据预填充" |
Gotchas
常见问题与解决方案
| Issue | Resolution |
|---|---|
| Multi-language OmniScript | Create separate versions per Language with shared Type/SubType; use translation workbench for labels |
| Embedded OmniScript data passing | Map parent data JSON keys to child OmniScript input via |
| Large Loop Block datasets | Paginate or limit DataRaptor results; consider server-side filtering in Integration Procedure (IP) |
| OmniScript in FlexCard flyout | Ensure FlexCard passes required context data; test flyout sizing |
| Community/Experience Cloud deployment | Verify OmniScript component is available in Experience Builder; check guest user permissions |
| Save & Resume (Save for Later) | Configure |
| Versioning conflicts | Deactivate old version before activating new; never have two active versions for same Type/SubType/Language triplet |
| Custom LWC in OmniScript | Register LWC as OmniScript-compatible; follow |
| Namespaced orgs | If deploying into a managed OmniStudio package org, prefix bundle names and API names with the appropriate namespace (e.g., |
| |
For common runtime troubleshooting (element not rendering, data not prefilling, IP action failing silently), see Section 8.
references/best-practices.md| 问题 | 解决方案 |
|---|---|
| 多语言OmniScript | 为每种语言创建独立版本,共享Type/SubType;使用翻译工作台处理标签 |
| 嵌入式OmniScript数据传递 | 通过 |
| Loop Block处理大型数据集 | 对DataRaptor结果进行分页或限制;考虑在Integration Procedure (IP)中实现服务器端过滤 |
| FlexCard弹出层中的OmniScript | 确保FlexCard传递所需上下文数据;测试弹出层尺寸 |
| 社区/体验云部署 | 验证OmniScript组件在Experience Builder中可用;检查访客用户权限 |
| 保存续填(Save for Later) | 配置 |
| 版本冲突 | 激活新版本前停用旧版本;同一Type/SubType/Language三元组不得存在两个激活版本 |
| OmniScript中使用自定义LWC | 将LWC注册为OmniScript兼容组件;遵循 |
| 命名空间组织 | 若部署到托管OmniStudio包组织,需为包名称和API名称添加适当的命名空间前缀(例如 |
创建时无法设置 | |
常见运行时故障排查(元素不渲染、数据不预填充、IP动作静默失败)请查看第8节。
references/best-practices.mdNotes
注意事项
API: 66.0 | Mode: Strict (warnings block) | Scoring: Block deployment if score < 67
Required upstream skills: ,
building-omnistudio-datamapperbuilding-omnistudio-integration-procedureOptional skills: , ,
deploying-metadatabuilding-omnistudio-flexcardanalyzing-omnistudio-dependenciesCreating OmniScripts programmatically: Use REST API (). Required fields: , , , , . OmniScripts default to — do NOT set directly (it is computed). The flag cannot handle JSON textarea fields like . Create child records via REST API for each Step and element.
sf api request rest --method POST --body @file.jsonNameTypeSubTypeLanguageVersionNumberIsIntegrationProcedure=falseOmniProcessTypesf data create record --valuesPropertySetConfigOmniProcessElementAPI版本:66.0 | 模式:严格(警告会阻止部署) | 评分规则:评分低于67分则禁止部署
必需上游技能:、
building-omnistudio-datamapperbuilding-omnistudio-integration-procedure可选技能:、、
deploying-metadatabuilding-omnistudio-flexcardanalyzing-omnistudio-dependencies程序化创建OmniScript:使用REST API()。必填字段:、、、、。OmniScript默认——请勿直接设置(该字段为计算字段)。无法处理这类JSON文本域字段。需通过REST API为每个Step和元素创建子记录。
sf api request rest --method POST --body @file.jsonNameTypeSubTypeLanguageVersionNumberIsIntegrationProcedure=falseOmniProcessTypesf data create record --valuesPropertySetConfigOmniProcessElementOutput Expectations
输出预期
Deliverables produced by this skill:
- OmniScript JSON (template) — OmniProcess record ready for REST API creation
assets/omni-process-omniscript.json - Step element JSON (template) — OmniProcessElement record for each Step (Level=0)
assets/omni-process-element-step.json - Element JSON (and similar) — OmniProcessElement records for child elements (Level=1+)
assets/omni-process-element-text-block.json - Validation report — 120-point score across 6 categories with pass/warn/block threshold result
本技能生成的交付物:
- OmniScript JSON(模板)——可通过REST API创建的OmniProcess记录
assets/omni-process-omniscript.json - Step元素JSON(模板)——每个Step对应的OmniProcessElement记录(Level=0)
assets/omni-process-element-step.json - 元素JSON(及类似模板)——子元素对应的OmniProcessElement记录(Level=1+)
assets/omni-process-element-text-block.json - 验证报告——6大类的120分评分结果,包含通过/警告/禁止阈值
Reference File Index
参考文件索引
| File | When to read |
|---|---|
| Phase 2 — Element selection: read before configuring PropertySetConfig for any element type |
| Phase 2-5 — Design patterns: read for step design, data prefill, validation, navigation, performance, and troubleshooting guidance |
| Phase 3 — Generation: use as the OmniProcess record template when building the OmniScript via REST API |
| Phase 3 — Generation: use as the Step (Level=0) OmniProcessElement record template |
| Phase 3 — Generation: use as the Text Block element template; adapt for other display element types |
| Phase 3 — Run before creating a new OmniScript to verify no duplicate Type/SubType/Language exists |
| Phase 4 — Run to deploy OmniScript and verify activation; includes prerequisite checks and error recovery |
| Any phase — Full CLI command reference for querying, retrieving, deploying, and verifying OmniScripts |
| 文件 | 阅读时机 |
|---|---|
| 阶段2——元素选择:配置任何元素类型的PropertySetConfig前阅读 |
| 阶段2-5——设计模式:获取步骤设计、数据预填充、验证、导航、性能和故障排查指导时阅读 |
| 阶段3——生成:通过REST API构建OmniScript时,用作OmniProcess记录模板 |
| 阶段3——生成:用作Step(Level=0)的OmniProcessElement记录模板 |
| 阶段3——生成:用作Text Block元素模板;可适配其他展示元素类型 |
| 阶段3——创建新OmniScript前运行,验证是否存在重复的Type/SubType/Language组合 |
| 阶段4——运行以部署OmniScript并验证激活状态;包含前置检查和错误恢复逻辑 |
| 任意阶段——查询、检索、部署和验证OmniScript的完整CLI命令参考 |