Skip to main content

#Omnistudio5 discussing

We're utilizing the Google API to search for an address and populate five read-only fields in Omni script if the address is found. If not, we're providing users with the option to manually enter the address via an LWC pop-up screen. After they've entered the address, we return to the Omni script. Although the fields are updating in JSON, the old values persist on the screen. How can we refresh the screen to display the new address data?

#Omnistudio
0/9000

 I have completed the following setup steps for OmniStudio Document Generation using IP response data. Are these steps correct and what should I do next? 

 

Steps You Have Completed:

1. Word Template

  • Created a Word document with tokens matching the IP response JSON structure
  • Example: {{Quote.QuoteNumber}}, {{Quote.AccountName}}

2. Document Template

  • Created a Document Template in Salesforce
  • Uploaded the Word template file
  • Configured with: 
    • Token Mapping Method Type: Omni Data Transformation
    • Document Generation Mechanism: Server-side
    • Usage Type: Contract Lifecycle Management (CLM)

3. Data Mapper (ODT)

  • Created a Data Mapper with: 
    • Type: Extract
    • Input: JSON
    • Output: JSON
  • Configured extraction rules to pull Quote and QuoteLines data from Salesforce

4. Integration Procedure (IP)

  • Created an IP
  • Added a Data Mapper Extract Action that calls the Data Mapper
  • Added a Response Action that returns data in the same structure as the Data Mapper output

5. OmniScript

  • Took the standard Single Doc Core - DOCX Serverside(LWC) OmniScript
  • Created a new version
  • Added an Integration Procedure Action that calls the created IP

 Are These Steps Correct? 

 

#Omnistudio #Revenue Cloud #Salesforce Developer #Vlocity

1 answer
  1. May 19, 2:21 PM

    @Jothish B S the standard osGenerateAndPreviewDocument component does not automatically take the response of any Integration Procedure action added earlier in the OmniScript and use it as token data. The generated document uses the JSON available to the document generation step, based on the template’s token mapping method.

    Trailhead explains that document templates can use JSON input data, and that the Token Mapping Method controls how tokens are populated. It also says you can use OmniDataTransform or a custom class for that mapping. Reference: (Trailhead)

    For your example token: {{Quote.QuoteNumber}} the JSON used by document generation must look like this:

    {  "Quote": {    "QuoteNumber": "Q-0001",    "AccountName": "ABC Customer"  }}

    If you have quote lines, the final JSON must also contain a repeatable array, for example:

    {  "Quote": {    "QuoteNumber": "Q-0001",    "AccountName": "ABC Customer",    "QuoteLines": [      {        "ProductName": "Product A",        "Quantity": 2      }    ]  }}

     

    Correction to do would be: don’t use an 

    Extract Data Mapper as the final token mapper if your source is already the IP response JSON. Use a Transform Data Mapper to shape the IP response into the exact JSON structure expected by the Word template.

    Also open the OmniScript preview/debug panel and check the Data JSON after the IP action runs. If the Quote node is not present at the root, or if it is nested under something like IPResult.Quote, your tokens will not resolve.

    For server-side generation, Salesforce also documents an Integration Procedure pattern using DocumentServiceGateway.generateDocumentWithTokenData, which is more suitable when the IP is responsible for preparing the full token JSON. Reference: (Salesforce)

     

    Decide the pattern:

    Use standard LWC + OmniScript JSON if the IP output is stored in the OmniScript JSON exactly as the template expects.

    Use server-side IP document generation if the IP should fully control token data and document generation.

    The missing part is mapping the IP response into the exact token JSON consumed by document generation.

0/9000

Hi everyone,

I'm currently working with OmniStudio Document Generation in an OmniScript, and I have a question regarding the "UseTemplateDRData" checkbox in the Arrange Template (Reorder Templates) step.

By default, this checkbox is always unchecked, and I would like it to be checked automatically for all selected templates.

Do you know if there is a way to:

  •  Set "UseTemplateDRData" = true by default
  •  Either via OmniScript configuration, DataRaptor, or any other workaround? 

I’m currently using multiple steps (template selection + additional documents), and I want to avoid users having to manually check this every time.

Any help or best practices would be greatly appreciated!

Thanks in advance 🙏 

Set

 

#Omnistudio

5 answers
  1. Mar 30, 7:55 PM

    Seems like not doable. I tried setting 'UseTemplateDRData' to true but it didn't worked. When you Preview the omniscript this is shown for that lwc component. I also found only this doc for the lwcSeems like not doable. I tried setting 'UseTemplateDRData' to true but it didn't worked. When you Preview the omniscript this is shown for that lwc component.

0/9000

I'm looking on how to pass the selected rows in a Flexcard data table to a parent omniscript. In this piece of documentation it only says that everytime a row is selected it triggers the "selectrow" event, but I'm not being able to get the event details in a parent omniscript not even in the parent flexcard. I'm not quite sure on how to handle the event listener (not to mention that since I can't see the event, I'm clueless on how to save the array sent by it).

Flexcard data table selectrow event handling how-to

Datatable Flexcard #Omnistudio

34 answers
  1. Nov 19, 2022, 1:56 AM

    Hi @Walter Fernandez. You can add the FlexCard to an LWC and handle the event programmatically as per https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.events_handling. See 'Attach an Event Listener Programmatically.'  The code below defines an LWC that updates the OmniScript JSON with the selected rows. Also useful: https://help.salesforce.com/s/articleView?id=sf.os_datatable_lightning_web_component_readme.htm&type=5

     

    Update: video explanation of selectrow event handling here: https://www.youtube.com/watch?v=WnHIXSzcdKM

    Update 2: see this resource for more details and sample code on this topic  https://quip.com/ftaxAqKJknkj

     

    <template>

        <!-- Embedded Flexcard -->    

        <c-cf-test-data-table-selectable></c-cf-test-data-table-selectable>    

    </template>

      

    import { LightningElement, api, track } from 'lwc';

    import { OmniscriptBaseMixin } from 'omnistudio/omniscriptBaseMixin';

    export default class DatatableSelectable extends OmniscriptBaseMixin(LightningElement) {

    selectedRows=[];

    connectedCallback(){

    this.template.addEventListener('selectrow', evt => {

    console.log('selectrow event', JSON.stringify(evt.detail.result));

    // if event's selectrow is true, add it to selectedRows; if false, it's been unchecked >> remove it

    if (evt.detail.result.selectrow) {

    this.selectedRows.push(evt.detail.result);

    } else {

    this.selectedRows.forEach(function(item, index, object) {

    if (item.uniqueKey === evt.detail.result.uniqueKey) {

    object.splice(index, 1);

    }

    })

    }

    this.omniApplyCallResp({"selectedRows": this.selectedRows });

    });

    }

    }

0/9000

Our users are having issues with our document generation procedure since our org was updated to Spring 26’

Running the procedure will sometimes just pull nothing through to the document at all and it’s a blank page.

But then if they retry 30 seconds later it works, tried diagnosing but can’t find an issue.

Anyone else experiencing this?

#Omnistudio
1 answer
0/9000

The Lightning Design System "Downloads" section

 reads: 

 

"It is no longer necessary to add a static resource for Lightning Components running within Lightning. See the FAQ for more information." 

 

But the FAQ link is 404. 

 

I'm asking because one of our developers wants to create and upload an SLDS static resource into a new repository and I'm wondering, "Is this really necessary?"

2 answers
  1. Jan 31, 12:54 PM

    In my case, we're trying to access SLDS icons from inside an Omniscript Output Text block. 

     

    Today's it's an image with src="" the static resource we loaded.  I was able to get it working without the resource in an LWC, but I guess the issue now is just

    #Omnistudio Omniscript.

0/9000

I was going through this trail for ExpressionSets  

 

https://trailhead.salesforce.com/content/learn/modules/advanced-rules-with-business-rules-engine/set-up-an-expression-set?trail_id=explore-business-rules-engine

 

 

 

It is talking about Object alias in ExpressionSet, for this trail it is talking about "

InsurancePremium

 

"  Object Alias for the Contact object.  

 

But I could not find where it is exactly configured. Please help me provide more information about this concepts  

#Trailhead Challenges  #Vlocity  #Omnistudio

1 answer
0/9000

Hello. Why omniscript reload when the method This.omniNavigateTo() is called from lwc that IS embeded in omniscript?

#Omnistudio #Omni #Vlocity #Vlocity Architects #Salesforce Developer #Salesforce Developers #Developer #Developers #Lightning Web Components
2 comments
  1. Dec 23, 2025, 6:42 AM

    The this.omniNavigateTo() function triggers a page navigation event. When used inside an LWC embedded within an OmniScript, it often bubbles up and causes the entire OmniScript container to refresh or re-initialize, looking like a "reload."

    Solution:

     

    Instead of this.omniNavigateTo(), use the

    OmniScriptBaseMixin events to communicate with the parent OmniScript without forcing a full page navigation.

    1. If moving to the Next Step:

    javascript

    this.dispatchEvent(new CustomEvent('omninesxtstep'));

    If updating data:

    javascript

    this.omniApplyCallResp({ "yourData": "value" });

    Why it happens: omniNavigateTo is designed for PageReference navigation (like moving from Salesforce Page A to Salesforce Page B). When you call it, the framework assumes you are leaving the current context, so it reloads the component wrapper. Avoid using it for simple step transitions inside the same OmniScript. 

    1. https://trailblazers.salesforce.com/profileView?u=0053A00000FTqkWQAT
0/9000

Hi everyone, 

 

I’m working on an OmniScript that includes a repeatable block on the Complaint Details

step. Inside the repeatable block, I ask the user whether they want to: 

 

 • Use an existing contact, or

 • Create a new contact

 

Based on this choice:

 

 • If the user selects existing contact, a typeahead component is shown to search and select a Contact record.

 • If the user selects new contact, a separate input field appears to capture the new contact’s details, which I later use to create a Contact record. 

 

The problem I’m encountering is this:

When I add multiple entries in the repeatable block and select “new contact” in the first entry, that choice applies to all repeatable items — causing the typeahead or new contact fields to show/hide in all rows together, rather than independently.

This prevents me from selecting an existing contact in one repeatable row and creating a new one in another. 

 

How can I make the conditional logic for the typeahead input work independently within each instance of the repeatable block? 

 

Thanks in advance for any guidance!

#Trailhead #Salesforce Developer #Omnistudio #Typeaheadblock #Repeatable Fields

2 answers
  1. Dec 12, 2025, 9:42 AM

     Unlocking the Per-Row Fix Use %

    Index% in conditional views for row-specific logic. 

    Easy Configuration: Radio: ContactType (New/Existing). 

    Display in Typeahead: {%ContactType%} == "Existing".  

     

    {%ContactType%} == "New" refers to a novel field.  

    Boom! distinct rows. Now try a few entries—mix 'n match works!

    @Steve Yagci If this helps you kindly let me know. 

0/9000

In Omniscript, I have a usecase where I created a Step and added some fields to capture user input for creating case records. Now I want to display the same Step multiple times to allow the user to provide details for multiple case records. The number of times this Step appears will depend on a variable I set using the SetValue element.

I'm trying to figure out how I can display the same Step multiple times. I don't see any loop element or decision element available.

I could create multiple Steps like Step1, Step2... Stepn, but that's not what I'm looking for.

  #Omnistudio

5 answers
  1. Nov 17, 2025, 7:15 AM

    Hi @Sonal .

    I know I am too late, but did you find any solution for this. I am stuck with a similar problem where I need to display a form multiple times on separate Steps. 

     

    @Nagarjuna Parala and @Manoj S I was recommended the approach of using a Block element but with the compromise of having everything on a single Step. Is it possible to have each instance of a Block group on a separate Step?

0/9000