sf-omniscript

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

sf-omniscript: OmniStudio OmniScript Creation and Validation

sf-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 Flow:无需编写代码即可实现多步骤交互式流程,支持收集输入、编排服务器端逻辑(Integration Procedure、DataRaptor)并向用户展示结果。

Quick Reference

快速参考

Scoring: 120 points across 6 categories. Thresholds: ✅ 90+ (Deploy) | ⚠️ 67-89 (Review) | ❌ <67 (Block - fix required)

评分体系:6个类别总计120分。阈值:✅ 90分及以上(可部署) | ⚠️ 67-89分(需审核) | ❌ 低于67分(阻止部署,需修复)

Core Responsibilities

核心职责

  1. OmniScript Generation: Create well-structured OmniScripts from requirements, selecting appropriate element types for each step
  2. Element Design: Configure PropertySetConfig JSON for each element with correct data binding, validation, and conditional logic
  3. Dependency Analysis: Map all references to Integration Procedures, DataRaptors, and embedded OmniScripts before deployment
  4. Data Flow Analysis: Trace data through the OmniScript JSON structure — from prefill through user input to final save actions

  1. OmniScript生成:根据需求创建结构规范的OmniScript,为每个步骤选择合适的元素类型
  2. 元素设计:为每个元素配置PropertySetConfig JSON,包含正确的数据绑定、验证规则和条件逻辑
  3. 依赖分析:部署前梳理所有对Integration Procedure、DataRaptor和嵌入式OmniScript的引用
  4. 数据流分析:追踪数据在OmniScript JSON结构中的流转——从预填充、用户输入到最终保存操作

CRITICAL: Orchestration Order

重要提示:编排顺序

sf-omnistudio-analyze → sf-datamapper → sf-integration-procedure → sf-omniscript → sf-flexcard (you are here: sf-omniscript)
OmniScripts consume Integration Procedures and DataRaptors. Build those FIRST. FlexCards may launch OmniScripts — build FlexCards AFTER. Use sf-omnistudio-analyze to map the full dependency tree before starting.

sf-omnistudio-analyze → sf-datamapper → sf-integration-procedure → sf-omniscript → sf-flexcard(当前处于:sf-omniscript)
OmniScript依赖Integration Procedure和DataRaptor,需先构建这两者。FlexCard可能会启动OmniScript,需在OmniScript之后构建。开始前请使用sf-omnistudio-analyze梳理完整的依赖树。

Key Insights

关键要点

InsightDetails
Type/SubType/Language tripletUniquely identifies an OmniScript. All three values are required and form the composite key. Example: Type=
ServiceRequest
, SubType=
NewCase
, Language=
English
PropertySetConfigJSON blob containing all element configuration — layout, data binding, validation rules, conditional visibility. This is where the real logic lives
Core namespaceOmniProcess with
IsIntegrationProcedure = false
(equivalently
OmniProcessType='OmniScript'
). Elements are child OmniProcessElement records
Element hierarchyElements use Level/Order fields for tree structure. Level 0 = Steps, Level 1+ = elements within steps. Order determines sequence within a level
Version managementMultiple versions can exist; only one can be active per Type/SubType/Language triplet. Activate via the
IsActive
field
Data JSONOmniScripts 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=
ServiceRequest
,SubType=
NewCase
,Language=
English
PropertySetConfig包含所有元素配置的JSON对象——布局、数据绑定、验证规则、条件可见性。核心逻辑均在此定义
核心命名空间OmniProcess需设置
IsIntegrationProcedure = false
(等价于
OmniProcessType='OmniScript'
)。元素为子OmniProcessElement记录
元素层级元素通过Level/Order字段构建树形结构。Level 0 = 步骤,Level 1+ = 步骤内的元素。Order字段决定同层级内的顺序
版本管理可存在多个版本,但每个Type/SubType/Language三元组仅能有一个激活版本。通过
IsActive
字段激活
数据JSONOmniScript在所有步骤中传递单个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
    English
    unless multi-language support is required
  • 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 Flow。对于仅展示数据无需交互的场景,可考虑使用FlexCard。
请用户提供以下信息
  • Type:流程类别(例如:
    ServiceRequest
    Enrollment
    ClaimSubmission
  • SubType:具体的流程变体(例如:
    NewCase
    UpdateAddress
    FileAppeal
  • Language:通常为
    English
    ,除非需要多语言支持
  • 用途:该OmniScript用于引导用户完成何种业务流程
  • 目标组织:部署的组织别名
  • 数据源:需要查询或更新哪些对象/API
后续操作:检查是否存在重复的OmniScript,识别可复用的Integration Procedure或DataRaptor,并梳理依赖链。

Phase 2: Design & Element Selection

阶段2:设计与元素选择

Design each step and select element types appropriate to the interaction pattern.
设计每个步骤,并根据交互模式选择合适的元素类型。

Container Elements

容器元素

Element TypePurposeKey Config
StepTop-level container for a group of UI elements; each Step is a page in the wizard
chartLabel
,
knowledgeOptions
,
show
(conditional visibility)
Conditional BlockShow/hide a group of elements based on conditions
conditionType
,
show
expression
Loop BlockIterate over a data list and render elements for each item
loopData
(JSON path to array)
Edit BlockInline editing container for tabular data
editFields
,
dataSource
元素类型用途关键配置
Step一组UI元素的顶层容器;每个Step对应向导中的一个页面
chartLabel
knowledgeOptions
show
(条件可见性)
Conditional Block根据条件显示/隐藏一组元素
conditionType
show
表达式
Loop Block遍历数据列表并为每个项渲染元素
loopData
(数组的JSON路径)
Edit Block表格数据的内联编辑容器
editFields
dataSource

Input Elements

输入元素

Element TypePurposeKey Config
TextSingle-line text input
label
,
placeholder
,
pattern
(regex validation)
Text AreaMulti-line text input
label
,
maxLength
,
rows
NumberNumeric input with optional formatting
label
,
min
,
max
,
step
,
format
DateDate picker
label
,
dateFormat
,
minDate
,
maxDate
Date/TimeDate and time picker
label
,
dateFormat
,
timeFormat
CheckboxBoolean toggle
label
,
defaultValue
RadioRadio button group for single selection
label
,
options
(static or data-driven)
SelectDropdown selection
label
,
options
,
optionSource
(static/data)
Multi-selectMultiple item selection
label
,
options
,
maxSelections
Type AheadSearch/autocomplete input
label
,
dataSource
,
searchField
,
minCharacters
SignatureSignature capture pad
label
,
penColor
,
backgroundColor
FileFile upload
label
,
maxFileSize
,
allowedExtensions
CurrencyCurrency input with locale formatting
label
,
currencyCode
,
min
,
max
EmailEmail input with format validation
label
,
placeholder
TelephonePhone number input with masking
label
,
mask
,
placeholder
URLURL input with format validation
label
,
placeholder
PasswordMasked text input
label
,
minLength
RangeSlider input
label
,
min
,
max
,
step
TimeTime picker
label
,
timeFormat
元素类型用途关键配置
Text单行文本输入
label
placeholder
pattern
(正则验证)
Text Area多行文本输入
label
maxLength
rows
Number数值输入(支持可选格式化)
label
min
max
step
format
Date日期选择器
label
dateFormat
minDate
maxDate
Date/Time日期时间选择器
label
dateFormat
timeFormat
Checkbox布尔值开关
label
defaultValue
Radio单选按钮组
label
options
(静态或数据驱动)
Select下拉选择框
label
options
optionSource
(静态/数据驱动)
Multi-select多选选择框
label
options
maxSelections
Type Ahead搜索/自动补全输入框
label
dataSource
searchField
minCharacters
Signature签名捕获面板
label
penColor
backgroundColor
File文件上传
label
maxFileSize
allowedExtensions
Currency货币输入(支持区域格式化)
label
currencyCode
min
max
Email邮箱输入(带格式验证)
label
placeholder
Telephone电话号码输入(带掩码)
label
mask
placeholder
URLURL输入(带格式验证)
label
placeholder
Password掩码文本输入
label
minLength
Range滑块输入
label
min
max
step
Time时间选择器
label
timeFormat

Display Elements

展示元素

Element TypePurposeKey Config
Text BlockStatic content display (HTML supported)
textContent
,
HTMLTemplateId
HeadlineSection heading
text
,
level
(h1-h6)
AggregateCalculated summary display
aggregateExpression
,
format
DisclosureExpandable/collapsible content
label
,
defaultExpanded
ImageImage display
imageURL
,
altText
ChartData visualization
chartType
,
dataSource
元素类型用途关键配置
Text Block静态内容展示(支持HTML)
textContent
HTMLTemplateId
Headline章节标题
text
level
(h1-h6)
Aggregate计算结果汇总展示
aggregateExpression
format
Disclosure可展开/折叠的内容
label
defaultExpanded
Image图片展示
imageURL
altText
Chart数据可视化
chartType
dataSource

Action Elements

动作元素

Element TypePurposeKey Config
DataRaptor Extract ActionPull data from Salesforce
bundle
,
inputMap
,
outputMap
DataRaptor Load ActionPush data to Salesforce
bundle
,
inputMap
Integration Procedure ActionCall server-side Integration Procedure
ipMethod
(Type_SubType),
inputMap
,
outputMap
,
remoteOptions
Remote ActionCall Apex @RemoteAction or REST
remoteClass
,
remoteMethod
,
inputMap
Navigate ActionPage navigation or redirection
targetType
,
targetId
,
URL
DocuSign Envelope ActionTrigger DocuSign envelope
templateId
,
recipientMap
Email ActionSend email
emailTemplateId
,
recipientMap
元素类型用途关键配置
DataRaptor Extract Action从Salesforce拉取数据
bundle
inputMap
outputMap
DataRaptor Load Action向Salesforce推送数据
bundle
inputMap
Integration Procedure Action调用服务器端Integration Procedure
ipMethod
(Type_SubType)、
inputMap
outputMap
remoteOptions
Remote Action调用Apex @RemoteAction或REST接口
remoteClass
remoteMethod
inputMap
Navigate Action页面导航或重定向
targetType
targetId
URL
DocuSign Envelope Action触发DocuSign信封
templateId
recipientMap
Email Action发送邮件
emailTemplateId
recipientMap

Logic Elements

逻辑元素

Element TypePurposeKey Config
Set ValuesVariable assignment and data transformation
elementValueMap
(key-value pairs)
ValidationInput validation rules with custom messages
validationFormula
,
errorMessage
FormulaCalculate values using formula expressions
expression
,
dataType
Submit ActionFinal submission of collected data
postMessage
,
preTransformBundle
,
postTransformBundle
元素类型用途关键配置
Set Values变量赋值与数据转换
elementValueMap
(键值对)
Validation带自定义提示的输入验证规则
validationFormula
errorMessage
Formula使用公式表达式计算值
expression
dataType
Submit Action收集数据的最终提交
postMessage
preTransformBundle
postTransformBundle

Phase 3: Generation & Validation

阶段3:生成与验证

bash
undefined
bash
undefined

Verify no duplicate Type/SubType/Language exists

Verify no duplicate Type/SubType/Language exists

sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND Language='<Language>' AND OmniProcessType='OmniScript'" -o <org>

**Build the OmniScript**:
1. Create the OmniProcess record with Type, SubType, Language, and OmniProcessType='OmniScript'
2. Create OmniProcessElement child records for each Step (Level=0)
3. Create OmniProcessElement child records for each element within Steps (Level=1+, ordered by Order field)
4. Configure PropertySetConfig JSON for each element
5. 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%)
undefined
sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND Language='<Language>' AND OmniProcessType='OmniScript'" -o <org>

**构建OmniScript**:
1. 创建OmniProcess记录,指定Type、SubType、Language,并设置OmniProcessType='OmniScript'
2. 为每个Step创建子OmniProcessElement记录(Level=0)
3. 为Step内的每个元素创建子OmniProcessElement记录(Level=1+,按Order字段排序)
4. 为每个元素配置PropertySetConfig JSON
5. 将动作元素关联到对应的Integration Procedure / DataRaptor

**验证(严格模式)**:
- **阻止部署**:缺失Type/SubType/Language、OmniScript循环嵌入、Integration Procedure/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%)
undefined

Phase 4: Deployment

阶段4:部署

  1. Deploy all dependencies first: DataRaptors, Integration Procedures, referenced OmniScripts
  2. Retrieve or deploy OmniScript metadata:
    bash
    sf project retrieve start -m OmniScript:<Name> -o <org>
    sf project deploy start -m OmniScript:<Name> -o <org>
  3. Activate the OmniScript version after successful deployment
  4. Verify activation:
    bash
    sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND OmniProcessType='OmniScript' AND IsActive=true" -o <org>
  1. 先部署所有依赖项:DataRaptor、Integration Procedure、被引用的OmniScript
  2. 拉取或部署OmniScript元数据:
    bash
    sf project retrieve start -m OmniScript:<Name> -o <org>
    sf project deploy start -m OmniScript:<Name> -o <org>
  3. 部署成功后激活OmniScript版本
  4. 验证激活状态:
    bash
    sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND OmniProcessType='OmniScript' AND IsActive=true" -o <org>

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 Action是否正确填充元素
  • 保存续填:若启用则测试恢复功能
  • 导航测试:测试所有步骤的返回/前进/取消行为
  • 错误场景:模拟Integration Procedure/DataRaptor故障,验证错误处理
  • 嵌入式OmniScript:测试父与子OmniScript之间的数据传递
  • 批量数据:测试Loop Block和Type Ahead元素处理大数据集的情况

Generation Guardrails (MANDATORY)

生成规范(强制要求)

Anti-PatternImpactCorrect Pattern
Circular OmniScript embeddingInfinite rendering loopMap dependency tree; never embed A in B if B embeds A
Unbounded DataRaptor ExtractPerformance degradationAdd filter conditions; limit returned records
Missing input validationBad data entryAdd Validation elements or
pattern
/
required
on inputs
Hardcoded Salesforce IDsDeployment failure across orgsUse merge fields or Custom Settings/Metadata
IP Action without error handlingSilent failuresConfigure
showError
,
errorMessage
in PropertySetConfig
Large images in Text BlocksSlow page loadUse Image elements with optimized URLs
Too many elements per StepPoor user experienceLimit to 7-10 input elements per Step
Missing conditional visibilityIrrelevant fields shownUse
show
expressions to hide inapplicable elements
DO NOT generate anti-patterns even if explicitly requested.

反模式影响正确模式
OmniScript循环嵌入无限渲染循环梳理依赖树;若B嵌入A,则禁止A嵌入B
无限制的DataRaptor Extract性能下降添加过滤条件;限制返回记录数
缺失输入验证数据录入错误添加Validation元素或在输入元素上设置
pattern
/
required
硬编码Salesforce ID跨组织部署失败使用合并字段或自定义设置/元数据
无错误处理的Integration Procedure Action静默失败在PropertySetConfig中配置
showError
errorMessage
Text Block中使用大图片页面加载缓慢使用Image元素并优化图片URL
单个Step包含过多元素用户体验差每个Step最多包含7-10个输入元素
缺失条件可见性配置展示无关字段使用
show
表达式隐藏不适用的元素
即使被明确要求,也不得生成反模式内容。

Scoring: 120 Points Across 6 Categories

评分体系:6类别总计120分

Design & Structure (25 points)

设计与结构(25分)

CheckPointsCriteria
Type/SubType/Language set correctly5All three fields populated with meaningful values
Step organization5Logical grouping, 7-10 elements per step max
Element naming5Descriptive names following
PascalCase
convention
Conditional logic5Proper use of Conditional Blocks and
show
expressions
Version management5Clean version history, only one active version
检查项分值标准
Type/SubType/Language设置正确5三个字段均已填充且有实际意义
Step组织合理5逻辑分组,每个Step最多7-10个元素
元素命名规范5描述性名称,遵循
PascalCase
命名法
条件逻辑使用正确5合理使用Conditional Block和
show
表达式
版本管理规范5版本历史清晰,仅一个激活版本

Data Integration (20 points)

数据集成(20分)

CheckPointsCriteria
DataRaptor references valid5All Extract/Load bundles exist and are active
Integration Procedure references valid5All IP actions reference active IPs
Input/Output maps correct5Data flows correctly between elements and actions
Data prefill configured5Initial data loaded before user interaction
检查项分值标准
DataRaptor引用有效5所有Extract/Load bundle均存在且已激活
Integration Procedure引用有效5所有Integration Procedure Action均引用已激活的Integration Procedure
输入/输出映射正确5元素与动作之间的数据流正确
数据预填充配置完成5用户交互前已加载初始数据

Error Handling (20 points)

错误处理(20分)

CheckPointsCriteria
Action elements have error handling5
showError
configured on all IP/DR actions
User-facing error messages5Clear, actionable error text
Validation on required inputs5All required fields have validation rules
Fallback behavior defined5Graceful handling when data sources return empty
检查项分值标准
动作元素配置错误处理5所有Integration Procedure/DataRaptor动作均配置
showError
用户友好的错误提示5错误文本清晰、可操作
必填输入项有验证规则5所有必填字段均配置验证规则
定义回退行为5数据源返回空值时可优雅处理

Performance (20 points)

性能(20分)

CheckPointsCriteria
No unbounded data fetches5All DataRaptor Extracts have filters/limits
Lazy loading configured5Action elements fire on step entry, not OmniScript load
Element count per Step reasonable5No Step with >15 elements
Conditional rendering used5Elements hidden when not applicable (not just invisible)
检查项分值标准
无无限制的数据拉取5所有DataRaptor Extract均配置过滤/限制条件
配置懒加载5动作元素在Step进入时触发,而非OmniScript加载时
单个Step的元素数量合理5无Step包含超过15个元素
使用条件渲染5不适用的元素被隐藏(而非仅不可见)

User Experience (20 points)

用户体验(20分)

CheckPointsCriteria
Logical step flow5Steps follow natural task progression
Input labels and help text5All inputs have clear labels and contextual help
Navigation controls5Back, Next, Cancel, Save for Later configured appropriately
Responsive layout5Elements configured for mobile and desktop breakpoints
检查项分值标准
步骤流逻辑清晰5步骤遵循自然的任务流程
输入项有标签和帮助文本5所有输入项均有清晰的标签和上下文帮助
导航控件配置合理5正确配置返回、前进、取消、保存续填按钮
响应式布局5元素针对移动端和桌面端断点配置

Security (15 points)

安全性(15分)

CheckPointsCriteria
No sensitive data in client-side JSON5Passwords, SSNs, tokens kept server-side
IP actions use server-side processing5Sensitive logic in Integration Procedures, not client OmniScript
Field-level access respected5Data access matches user profile/permission set

检查项分值标准
客户端JSON中无敏感数据5密码、社保号、令牌等数据保留在服务器端
Integration Procedure动作使用服务器端处理5敏感逻辑在Integration Procedure中实现,而非客户端OmniScript
遵循字段级访问权限5数据访问权限与用户配置文件/权限集匹配

CLI Commands

CLI命令

bash
undefined
bash
undefined

List active OmniScripts

List active OmniScripts

sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE IsActive=true AND OmniProcessType='OmniScript'" -o <org>
sf data query -q "SELECT Id,Name,Type,SubType,Language,IsActive,VersionNumber FROM OmniProcess WHERE IsActive=true AND OmniProcessType='OmniScript'" -o <org>

Query elements for a specific OmniScript

Query elements for a specific OmniScript

sf data query -q "SELECT Id,Name,ElementType,PropertySetConfig,Level,Order FROM OmniProcessElement WHERE OmniProcessId='<id>' ORDER BY Level,Order" -o <org>
sf data query -q "SELECT Id,Name,ElementType,PropertySetConfig,Level,Order FROM OmniProcessElement WHERE OmniProcessId='<id>' ORDER BY Level,Order" -o <org>

Retrieve OmniScript metadata

Retrieve OmniScript metadata

sf project retrieve start -m OmniScript:<Name> -o <org>
sf project retrieve start -m OmniScript:<Name> -o <org>

Deploy OmniScript metadata

Deploy OmniScript metadata

sf project deploy start -m OmniScript:<Name> -o <org>
sf project deploy start -m OmniScript:<Name> -o <org>

Check OmniScript versions

Check OmniScript versions

sf data query -q "SELECT Id,VersionNumber,IsActive,LastModifiedDate FROM OmniProcess WHERE Type='<Type>' AND SubType='<SubType>' AND OmniProcessType='OmniScript' ORDER BY VersionNumber DESC" -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" -o <org>

---

Cross-Skill Integration

跨技能集成

From SkillTo sf-omniscriptWhen
sf-omnistudio-analyze-> sf-omniscript"Analyze dependencies before building OmniScript"
sf-datamapper-> sf-omniscript"DataRaptor ready, build the OmniScript that uses it"
sf-integration-procedure-> sf-omniscript"IP ready, wire it into the OmniScript action"
From sf-omniscriptTo SkillWhen
sf-omniscript-> sf-flexcard"Build FlexCard that launches this OmniScript"
sf-omniscript-> sf-deploy"Deploy OmniScript to target org"
sf-omniscript-> sf-omnistudio-analyze"Map full dependency tree before deployment"
sf-omniscript-> sf-integration-procedure"Need a new IP for this OmniScript action"
sf-omniscript-> sf-datamapper"Need a DataRaptor for data prefill"

来源技能目标sf-omniscript触发时机
sf-omnistudio-analyze-> sf-omniscript"构建OmniScript前分析依赖"
sf-datamapper-> sf-omniscript"DataRaptor已就绪,构建使用它的OmniScript"
sf-integration-procedure-> sf-omniscript"Integration Procedure已就绪,将其关联到OmniScript动作"
来源sf-omniscript目标技能触发时机
sf-omniscript-> sf-flexcard"构建启动该OmniScript的FlexCard"
sf-omniscript-> sf-deploy"将OmniScript部署到目标组织"
sf-omniscript-> sf-omnistudio-analyze"部署前梳理完整依赖树"
sf-omniscript-> sf-integration-procedure"为OmniScript动作创建新的Integration Procedure"
sf-omniscript-> sf-datamapper"为数据预填充创建DataRaptor"

Edge Cases

边缘场景

ScenarioSolution
Multi-language OmniScriptCreate separate versions per Language with shared Type/SubType. Use translation workbench for labels
Embedded OmniScript data passingMap parent data JSON keys to child OmniScript input via
prefillJSON
. Test data round-trip
Large Loop Block datasetsPaginate or limit DataRaptor results. Consider server-side filtering in IP
OmniScript in FlexCard flyoutEnsure FlexCard passes required context data. Test flyout sizing
Community/Experience Cloud deploymentVerify OmniScript component is available in Experience Builder. Check guest user permissions
Save & Resume (Save for Later)Configure
saveNameTemplate
,
saveExpireInDays
. Test resume with partial data
Versioning conflictsDeactivate old version before activating new. Never have two active versions for same triplet
Custom Lightning Web Components in OmniScriptRegister LWC as OmniScript-compatible. Follow
omniscript-lwc
namespace conventions
Debug: OmniScript not rendering -> check activation status + element hierarchy | Data not prefilling -> verify DataRaptor Extract output mapping + JSON path | IP action failing -> check IP independently first + verify input map | Steps not showing -> review conditional visibility expressions

场景解决方案
多语言OmniScript为每种Language创建单独版本,共享Type/SubType。使用翻译工作台处理标签
嵌入式OmniScript数据传递通过
prefillJSON
将父数据JSON的键映射到子OmniScript的输入。测试数据往返流程
大型Loop Block数据集对DataRaptor结果进行分页或限制。考虑在Integration Procedure中实现服务器端过滤
FlexCard弹出层中的OmniScript确保FlexCard传递必要的上下文数据。测试弹出层尺寸
社区/体验云部署验证OmniScript组件在Experience Builder中可用。检查访客用户权限
保存续填配置
saveNameTemplate
saveExpireInDays
。测试使用部分数据恢复的功能
版本冲突激活新版本前先停用旧版本。同一三元组不得有两个激活版本
OmniScript中的自定义Lightning Web Components将LWC注册为OmniScript兼容组件。遵循
omniscript-lwc
命名空间规范
调试指南:OmniScript无法渲染 -> 检查激活状态 + 元素层级 | 数据未预填充 -> 验证DataRaptor Extract输出映射 + JSON路径 | Integration Procedure动作失败 -> 先单独测试Integration Procedure + 验证输入映射 | 步骤未显示 -> 检查条件可见性表达式

Notes

说明

Dependencies (required): sf-datamapper, sf-integration-procedure | Dependencies (optional): sf-deploy, sf-flexcard, sf-omnistudio-analyze | API: 66.0 | Mode: Strict (warnings block) | Scoring: Block deployment if score < 67 | Reference docs: See
references/
for element types and best practices
Creating OmniScripts programmatically: Use REST API (
sf api request rest --method POST --body @file.json
). Required fields:
Name
,
Type
,
SubType
,
Language
,
VersionNumber
. OmniScripts default to
IsIntegrationProcedure=false
(do NOT set
OmniProcessType
— it is computed). The
sf data create record --values
flag cannot handle JSON textarea fields like
PropertySetConfig
. Create child
OmniProcessElement
records via REST API for each Step and element.
依赖项(必填):sf-datamapper、sf-integration-procedure | 依赖项(可选):sf-deploy、sf-flexcard、sf-omnistudio-analyze | API版本:66.0 | 模式:严格(警告会阻止部署) | 评分规则:评分低于67分则阻止部署 | 参考文档:请查看
references/
目录获取元素类型和最佳实践
程序化创建OmniScript:使用REST API(
sf api request rest --method POST --body @file.json
)。必填字段:
Name
Type
SubType
Language
VersionNumber
。OmniScript默认
IsIntegrationProcedure=false
(请勿设置
OmniProcessType
— 该字段为计算字段)。
sf data create record --values
命令无法处理
PropertySetConfig
这类JSON文本字段。请通过REST API为每个Step和元素创建子
OmniProcessElement
记录。