Loading...
Loading...
OmniStudio OmniScript creation and validation with 120-point scoring. Use when building guided digital experiences, multi-step forms, or interactive processes that orchestrate Integration Procedures and Data Mappers. TRIGGER when: user creates OmniScripts, designs step flows, configures element types, or reviews existing OmniScript configurations. DO NOT TRIGGER when: building FlexCards (use omnistudio-flexcard-generate), creating Integration Procedures directly (use omnistudio-integration-procedure-generate), or analyzing dependencies (use omnistudio-dependencies-analyze).
npx skill4agent add forcedotcom/sf-skills omnistudio-omniscript-generateomnistudio-flexcard-generateomnistudio-integration-procedure-generateomnistudio-dependencies-analyzeplatform-metadata-deploy| 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 |
| 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 |
ServiceRequestEnrollmentClaimSubmissionNewCaseUpdateAddressFileAppealEnglish| 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 | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
scripts/check-duplicate-omniscript.sh <Type> <SubType> <Language> <org>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%)sf org display -o <org>scripts/deploy-omniscript.sh <Name> <Type> <SubType> <org>| 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 |
| 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 |
| 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 |
| 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 |
| 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) |
| 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 |
| 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 |
scripts/cli-reference.sh# List active OmniScripts
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
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
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>| From Skill | To omnistudio-omniscript-generate | When |
|---|---|---|
| omnistudio-dependencies-analyze | -> omnistudio-omniscript-generate | "Analyze dependencies before building OmniScript" |
| omnistudio-datamapper-generate | -> omnistudio-omniscript-generate | "DataRaptor ready, build the OmniScript that uses it" |
| omnistudio-integration-procedure-generate | -> omnistudio-omniscript-generate | "IP ready, wire it into the OmniScript action" |
| From omnistudio-omniscript-generate | To Skill | When |
|---|---|---|
| omnistudio-omniscript-generate | -> omnistudio-flexcard-generate | "Build FlexCard that launches this OmniScript" |
| omnistudio-omniscript-generate | -> platform-metadata-deploy | "Deploy OmniScript to target org" |
| omnistudio-omniscript-generate | -> omnistudio-dependencies-analyze | "Map full dependency tree before deployment" |
| omnistudio-omniscript-generate | -> omnistudio-integration-procedure-generate | "Need a new IP for this OmniScript action" |
| omnistudio-omniscript-generate | -> omnistudio-datamapper-generate | "Need a DataRaptor for data prefill" |
| 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., |
| |
references/best-practices.mdomnistudio-datamapper-generateomnistudio-integration-procedure-generateplatform-metadata-deployomnistudio-flexcard-generateomnistudio-dependencies-analyzesf api request rest --method POST --body @file.jsonNameTypeSubTypeLanguageVersionNumberIsIntegrationProcedure=falseOmniProcessTypesf data create record --valuesPropertySetConfigOmniProcessElementassets/omni-process-omniscript.jsonassets/omni-process-element-step.jsonassets/omni-process-element-text-block.json| 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 |