Blogs

How to use loop in apex Salesforce

Loops are a fundamental concept in Apex programming that allow developers to execute a block of code repeatedly until a specific condition is met. In Salesforce Apex, loops are commonly used to process records from SOQL queries, collections like lists and maps, and bulk data operations. In this article, we will learn how to use loops in Apex, explore different types of loops available, and understand best practices for using them efficiently in Salesforce. Why Loops Are Important in Apex Salesforce enforces strict governor limits, especially when dealing with database operations. Loops help developers: Using loops correctly is critical for writing bulk-safe Apex code. Types of Loops in Apex Apex supports the following types of loops: Let’s explore each one with examples and use cases. 1. For Loop in Apex The for loop is used when you know exactly how many times the loop should execute. Syntax for(Integer i = 0; i < 5; i++) {     System.debug(i); } How It Works Use Case 2. For-Each Loop in Apex The for-each loop is the most commonly used loop in Salesforce because it works efficiently with collections. Syntax List<Account> accList = [SELECT Id, Name FROM Account LIMIT 10]; for(Account acc : accList) {     System.debug(acc.Name); } Why It’s Preferred Best Use Case SOQL For Loop (Best Practice) Salesforce recommends using SOQL for loops for large datasets. Syntax for(Account acc : [SELECT Id, Name FROM Account]) {     System.debug(acc.Name); } Advantages 3. While Loop in Apex A while loop runs as long as the specified condition remains true. Syntax Integer count = 0; while(count < 5) {     System.debug(count);     count++; } Use Case Caution Always ensure the condition becomes false; otherwise, it can result in an infinite loop. 4. Do-While Loop in Apex The do-while loop executes the code block at least once, even if the condition is false. Syntax Integer num = 0; do {     System.debug(num);     num++; } while(num < 5); Key Difference Using Loops with Maps Maps are frequently used in Apex for key-value data processing. Example Map<Id, Account> accMap = new Map<Id, Account>(     [SELECT Id, Name FROM Account LIMIT 5] ); for(Id accId : accMap.keySet()) {     System.debug(accMap.get(accId).Name); } Loops in Triggers (Bulk-Safe Example) Triggers always handle multiple records, so loops are mandatory. Example trigger AccountTrigger on Account (before insert) {     for(Account acc : Trigger.new) {         acc.Description = ‘Created via Trigger’;     } } This ensures: Common Mistakes to Avoid Best Practices for Using Loops in Apex Conclusion Loops are an essential building block in Apex programming. Whether you are working with triggers, classes, batch jobs, or integrations, understanding how to use loops correctly helps you write efficient, scalable, and governor-limit-safe code. By mastering for loops, for-each loops, while loops, and do-while loops, you can confidently handle complex data processing in Salesforce.

How to use loop in apex Salesforce Read More »

How to Create an Apex Class in Salesforce

Apex is Salesforce’s proprietary, strongly typed programming language used to execute server-side logic. Apex classes allow developers to extend Salesforce functionality by implementing business logic, integrations, triggers, controllers, and batch processing. In this article, we will learn how to create an Apex class in Salesforce using two common methods: Both approaches are widely used depending on your development workflow. What Is an Apex Class? An Apex class is a blueprint that contains: Apex classes are used in: Creating Apex classes correctly is essential for building scalable Salesforce applications. Method 1: Create an Apex Class Using Developer Console This method is simple and best suited for beginners or quick development tasks. Step 1: Log in to Salesforce Step 2: Access Developer Console Step 3: Create a New Apex Class Step 4: Write Apex Code Once the editor opens, write your Apex logic.Below is a simple example: public class MyApexClass {     public String greeting {         get {             return ‘Hello, Salesforce!’;         }     } } This example demonstrates: Step 5: Save the Apex Class Step 6: Compile and Check for Errors Step 7: Use the Apex Class Once compiled successfully, the Apex class can be used in: Method 2: Create an Apex Class Using Visual Studio Code (VS Code) This is the recommended method for professional Salesforce development, especially when working with source control and multiple developers. Step 1: Install Visual Studio Code Step 2: Install Salesforce Extensions This extension provides: Step 3: Open Your Salesforce Project Step 4: Create a New Apex Class Step 5: Write Apex Code VS Code will automatically generate a basic class structure.You can now add your logic inside the class. Step 6: Save the Apex Class Step 7: Deploy Apex Class to Salesforce You can deploy the Apex class using: Once deployed, the class becomes available in your Salesforce org. Best Practices for Creating Apex Classes Conclusion Creating an Apex class is a foundational skill for Salesforce developers. Whether you use the Developer Console for quick tasks or Visual Studio Code for enterprise development, understanding both methods gives you flexibility and control. By mastering Apex classes, you unlock the ability to build powerful business logic, integrations, and custom automation within Salesforce.

How to Create an Apex Class in Salesforce Read More »

How to Make Set Value and Response Action in IP.

  Integration Procedures (IP) in Salesforce OmniStudio are used to process, transform, and exchange data between Salesforce, OmniScripts, FlexCards, and external systems. Two very important elements inside an Integration Procedure are Set Values and Response Action. In this article, we will learn how to use Set Values and Response Action in an Integration Procedure, why they are needed, and how they work together to send clean, structured data to OmniScript or FlexCard. Why Set Values and Response Action Are Important Set Values helps you create or modify data inside the Integration Procedure Response Action controls what data is returned to OmniScript or FlexCard Together, they help avoid sending unnecessary or unstructured data They improve performance, readability, and maintainability These elements are commonly used in real-time integrations and UI-driven processes. What Is Set Values in Integration Procedure? Set Values is used to: Create new JSON nodes Assign values to variables Transform response data Prepare output data for OmniScript or FlexCard Set Values does not fetch data; it only manipulates existing data. What Is Response Action in Integration Procedure? Response Action defines: What happens at the end of the Integration Procedure Which data is sent back to the calling component Whether full JSON or selected output is returned Without a Response Action, data cannot be reliably consumed by OmniScript. Step 1: Create an Integration Procedure Go to OmniStudio → Integration Procedures Create or open an Integration Procedure Add required steps (DataRaptor, HTTP Action, etc.) Save the Integration Procedure Step 2: Use Set Values in Integration Procedure Add Set Values Element Drag Set Values onto the Integration Procedure canvas Place it after the step whose data you want to transform Configure Set Values Inside Set Values: Define Key (output field name) Define Value (source data path or static value) Example If your response contains: response.Account.Name You can map it as: Key: AccountName Value: {response.Account.Name} This creates a clean output node called AccountName. Why Use Set Values? To rename fields To combine multiple values To remove unnecessary nested JSON To prepare data for Response Action Step 3: Add Response Action in Integration Procedure Add Response Action Drag Response Action to the canvas Place it at the end of the Integration Procedure Configure Response Action Key configuration options: Return Full Data JSON True: returns entire response False: returns only mapped output Send JSON Path Specifies which node to send forward For clean output, keep Return Full Data JSON set to False. Step 4: Configure Additional Output Response What Is Additional Output Response? Additional Output Response allows you to explicitly define what data is returned. How to Configure Enable Additional Output Response Map keys from Set Values Choose only required fields Return Only Additional Output Set Return Only Additional Output = True This ensures only clean, required data is returned Recommended for production implementations Step 5: Preview and Test Integration Procedure Go to the Preview tab Provide test input parameters Click Execute Verify output JSON structure This helps confirm Set Values and Response Action are working correctly. How OmniScript Uses This Data In OmniScript: Add an Integration Procedure Action Pass input using Extra Payload Capture response using Response JSON Path Use data in: Text blocks Set Values Decisions Navigation logic Best Practices Always use Set Values before Response Action Avoid returning full JSON unless required Use meaningful key names Enable Return Only Additional Output Test IP independently before using in OmniScript Keep output lightweight and structured Common Mistakes to Avoid Skipping Response Action Returning unnecessary full JSON Incorrect JSON path mapping Not testing with real input values Overloading Integration Procedure with logic Conclusion Set Values and Response Action are essential building blocks in Integration Procedures. Set Values prepares and structures the data, while Response Action ensures only the required data is sent back to OmniScript or FlexCard. Mastering these two elements helps you build clean, efficient, and scalable OmniStudio integrations.

How to Make Set Value and Response Action in IP. Read More »

How to Embed OmniScript in Another OmniScript in Salesforce

OmniScript is a powerful declarative tool in Salesforce Industries (Vlocity) that helps create guided user experiences. One of its most useful features is the ability to embed one OmniScript inside another OmniScript, making processes reusable, modular, and easier to maintain. In this article, we will explore how to embed an OmniScript in another OmniScript, understand the concept of Reusable OmniScripts, and walk through the step-by-step implementation. What Is a Reusable OmniScript? A Reusable OmniScript is an OmniScript that is designed to be called or embedded inside another OmniScript. Instead of building the same logic repeatedly, you can create one OmniScript and reuse it across multiple parent OmniScripts. Benefits of Reusable OmniScripts Reduces duplicate development Improves consistency across processes Simplifies maintenance and updates Speeds up OmniScript development Once an OmniScript is marked as reusable, it becomes callable from other OmniScripts. Use Case for Embedding an OmniScript Embedding OmniScripts is useful when: You have common data collection sections (e.g., address, contact info) You want to reuse validation or business logic Multiple OmniScripts follow the same sub-process You want a modular and scalable OmniScript design Step 1: Create a Reusable OmniScript The first step is to create the OmniScript that you want to reuse. Steps to Create a Reusable OmniScript Go to Setup in Salesforce. Search for OmniScript. Click New OmniScript. Fill in required details such as: Type Subtype Language In the Setup section, check the Reusable checkbox. Save the OmniScript. Step 2: Design the Reusable OmniScript After creating the reusable OmniScript, design its structure. Best Practices Add a Text Block, Input Field, or any component to identify the OmniScript Keep it focused on a single responsibility Avoid unnecessary navigation elements For example, you may add a Text Block with a value like: “This is Reusable/Child OmniScript” This helps identify the reusable OmniScript when it is embedded. Step 3: Activate the Reusable OmniScript Activation is mandatory before the OmniScript can be used elsewhere. Activation Steps Go to the Build section of the reusable OmniScript. Validate the OmniScript to ensure there are no errors. Click Activate. Once activated, the OmniScript becomes available to embed in a parent OmniScript Step 4: Create the Parent OmniScript Now, create the OmniScript where you want to embed the reusable OmniScript. Steps to Create Parent OmniScript Go to Setup → OmniScript. Click New OmniScript. Enter the required details. Save and open the OmniScript in Build mode. This OmniScript will act as the Parent OmniScript. Step 5: Embed the Reusable OmniScript This is the key step where the reusable OmniScript is embedded into the parent OmniScript. Steps to Embed OmniScript Open the Build section of the Parent OmniScript. Scroll down to the Reusable OmniScript section. Locate the reusable OmniScript by its Name. Drag and drop the reusable OmniScript onto the canvas. Once dropped, the child OmniScript becomes part of the parent OmniScript flow. Step 6: Map and Use Data from Child OmniScript When a reusable OmniScript is embedded: All data collected in the child OmniScript becomes available to the parent OmniScript Data is automatically passed up to the parent data JSON You can now: Display child OmniScript values in the parent OmniScript Use the data for integration procedures Apply validations or conditions based on child data Step 7: Activate and Preview the Parent OmniScript After embedding the reusable OmniScript: Validate the Parent OmniScript. Click Activate. Click Preview. In preview mode, you will see the embedded OmniScript content displayed inside the parent OmniScript. For example, if the child OmniScript contains the text: “This is Reusable/Child OmniScript” It will appear within the parent OmniScript, confirming that embedding was successful. Key Points to Remember Reusable OmniScript must be activated before embedding Child OmniScript data automatically flows to the parent Keep reusable OmniScripts simple and focused Avoid navigation elements like Next/Previous in child OmniScripts Test both child and parent OmniScripts thoroughly Conclusion Embedding one OmniScript inside another OmniScript is a powerful feature that promotes reusability, modular design, and efficiency in Salesforce Industries. By creating reusable OmniScripts and embedding them into parent OmniScripts, you can build scalable guided processes with minimal effort. This approach not only saves development time but also ensures consistency across business workflows. With proper design and activation, reusable OmniScripts become an essential building block for advanced OmniScript implementations.

How to Embed OmniScript in Another OmniScript in Salesforce Read More »

How To Use SetValues In Integration Procedure

Integration Procedures (IPs) in Salesforce Industries are used to process data efficiently without writing code. One of the most commonly used elements inside an Integration Procedure is SetValues. It allows you to manipulate, merge, calculate, and transform data before sending it to the output or another system. In this article, we will learn how to use SetValues in an Integration Procedure, how to merge element values, perform calculations, concatenate fields, and finally display the result using Response Action. What Is SetValues in Integration Procedure? SetValues is an element in Integration Procedure that allows you to: Assign static values Merge values from different elements Perform calculations using formulas Concatenate multiple fields Retrieve values from arrays or lists It helps prepare and structure data in the required format before sending it to OmniScript, FlexCard, or an external system. Use Case of SetValues SetValues is commonly used when: You need to combine multiple input fields You want to format output data Calculations are required without Apex Data needs to be reused in another SetValues Final output must be shown in Preview or Response Step 1: Create an Integration Procedure The first step is to create an Integration Procedure. Steps: Go to Setup. Search for Integration Procedure. Click New. Enter required details such as: Name Type Subtype Language Save the Integration Procedure. Once created, open it in Designer mode. Step 2: Add SetValues to the Structure Panel Now, add the SetValues element to the Integration Procedure. Steps: Open the Structure Panel. Drag and drop SetValues into the Integration Procedure flow. Rename it meaningfully (for example: SetValues_1). This SetValues element will be used to define and manipulate data values. Step 3: Configure Element Value Mapping Inside SetValues, you define how values are assigned or merged. Element Value Map Configuration: Click on the SetValues element. Go to the Element Value Map section. Click Add New Value. Define: Element Name (output variable) Value (static value, merge field, or formula) This mapping helps transfer data from input JSON or other elements into new variables. Step 4: Perform Operations Using SetValues SetValues supports multiple operations that can be performed easily. Common Operations in SetValues Merge Fields You can merge values from input or previous elements using merge syntax. Example: %Input:FirstName%   Calculations Using Formulas You can perform mathematical operations like addition or multiplication. Example: %Input:Price% * %Input:Quantity%   Concatenate Two Merge Fields You can combine multiple fields into one value. Example: %Input:FirstName% %Input:LastName%   Retrieving an Array Value You can access values from an array using index-based notation. Example: %Input:Items[0].Name% These features allow you to handle complex logic without writing Apex code. In SetValues Step 5: Configure a Second SetValues for Concatenation In many cases, one SetValues depends on values created in another SetValues. Steps: Drag and drop another SetValues element. Rename it (for example: SetValues_2). In the Element Value Map: Reference values created in the first SetValues Concatenate or manipulate them as needed Example: %SetValues_1:FullName% – %SetValues_1:TotalAmount%   This shows how data can flow from one SetValues element to another. In SetValues 2 Step 6: Add Response Action to Display Output To display the output data in the Preview Tab, you must use Response Action. Steps: Drag Response Action into the Structure Panel. Configure it to return the required data nodes. Map the values created in SetValues to the Response Action output. Without Response Action, the output will not be visible during execution. In Response Action Step 7: Execute and View Results in Preview Tab After completing the configuration: Steps: Click Validate to ensure there are no errors. Click Activate. Click Execute. Go to the Preview Tab. You will now see: Merged values Calculated results Concatenated fields Final output structure This confirms that SetValues and Response Action are working correctly. On preview tab Best Practices for Using SetValues Use meaningful names for SetValues elements Avoid complex logic in a single SetValues Chain SetValues for better readability Always use Response Action for output visibility Validate and test with sample input data Conclusion SetValues is a powerful and essential component of Integration Procedures in Salesforce Industries. It allows you to merge, calculate, concatenate, and transform data without writing Apex code. By combining multiple SetValues and using Response Action, you can efficiently control the data flow and output of your Integration Procedure. Mastering SetValues helps you build scalable, reusable, and maintainable integrations that work seamlessly with OmniScripts and FlexCards.

How To Use SetValues In Integration Procedure Read More »

How To Enable Flex Card in OmniStudio(Vlocity) Salesforce

FlexCards are a core UI component of Salesforce OmniStudio (Vlocity). They allow you to display data in a responsive, reusable, and dynamic card-based layout without writing code. Before you can create or use FlexCards, you must ensure that OmniStudio and FlexCards are properly enabled in your Salesforce org. This article explains how to enable FlexCard in OmniStudio, including required permissions, settings, and verification steps. What Is a FlexCard in OmniStudio? A FlexCard is a lightweight UI component used to: Display Salesforce or external data Work with OmniScripts and Integration Procedures Show summary views, KPIs, or record details Reuse UI logic across apps and pages FlexCards are part of the OmniStudio Designer and rely on proper feature enablement and user access. Prerequisites to Enable FlexCard Before enabling FlexCards, make sure: OmniStudio (Vlocity) is installed in your org You have System Administrator access Required OmniStudio licenses are assigned Your org is Lightning Experience–enabled Step 1: Verify OmniStudio Is Installed FlexCards are available only if OmniStudio is installed. Steps: Go to Setup Search for Installed Packages Verify that OmniStudio, Vlocity, or Salesforce Industries package is installed If OmniStudio is not installed, FlexCards will not appear. you do not do the setting then this is the error Step 2: Enable OmniStudio Designer FlexCards are created inside OmniStudio Designer, so this must be enabled. Steps: Go to Setup Search for OmniStudio Settings Enable: OmniStudio Designer OmniStudio Runtime Save the settings This allows access to FlexCards, OmniScripts, DataRaptors, and Integration Procedures. Warning Tab Click Than Show This Link Remote Site Setting Step 3: Assign Required Permission Sets Even if OmniStudio is enabled, FlexCards will not be visible without proper permissions. Required Permission Sets: OmniStudio Admin OmniStudio Designer OmniStudio Runtime Steps: Go to Setup Open Users Select your user Click Permission Set Assignments Assign the required OmniStudio permission sets Log out and log in again after assignment. Fill the Tab Step 4: Enable FlexCard Feature Access FlexCards are controlled through OmniStudio capabilities. Steps: Go to Setup Search for Custom Permissions Ensure permissions related to: FlexCard OmniStudio UI Vlocity Cards are enabled via permission sets This ensures the FlexCard option appears in the Designer. Step 5: Access FlexCard from OmniStudio Designer Once enabled, you can access FlexCards. Steps: Click the App Launcher Search for OmniStudio Designer Open OmniStudio Designer Select FlexCards from the left panel Click New to create a FlexCard If FlexCard appears in the menu, it is successfully enabled. Step 6: Verify FlexCard Availability in Lightning App Builder FlexCards can be embedded into Lightning pages. Steps: Go to Lightning App Builder Edit a Record Page or App Page Search for FlexCard in Components Drag and drop it onto the page Configure required properties This confirms FlexCards are available at runtime. Common Issues and Troubleshooting FlexCard Not Visible in OmniStudio Designer Check OmniStudio permission sets Verify OmniStudio Designer is enabled Confirm package installation FlexCard Not Rendering on Page Ensure OmniStudio Runtime permission is assigned Activate the FlexCard Check Data Source configuration No Data Displayed Validate DataRaptor or Integration Procedure Confirm context variables like {recordId} Best Practices for Using FlexCards Always activate FlexCards before use Use reusable FlexCards for performance Prefer Integration Procedures for complex logic Test FlexCards using Preview mode Use context variables for dynamic data Conclusion Enabling FlexCards in OmniStudio is a foundational step for building modern, scalable Salesforce UI solutions. By ensuring OmniStudio is installed, permissions are assigned, and Designer access is enabled, you can start creating powerful FlexCards that integrate seamlessly with OmniScripts and Integration Procedures. Once enabled, FlexCards help you deliver faster, more interactive user experiences without writing Apex or Lightning Web Components.

How To Enable Flex Card in OmniStudio(Vlocity) Salesforce Read More »

How To Use ListAction In Integration Procedures

In OmniStudio (Vlocity) Salesforce, Integration Procedures (IP) are used to process data efficiently without writing Apex code. One of the most powerful elements inside an Integration Procedure is ListAction. ListAction allows you to loop through a list of records and perform actions on each item individually. In this article, we will understand what ListAction is, why it is used, and how to configure it step by step inside an Integration Procedure. What Is ListAction in Integration Procedure? ListAction is a looping mechanism in an Integration Procedure. It iterates over an array or list of data and executes child elements (like SetValues, DataRaptor, Integration Action, or Response Action) for each item in the list. It works similar to a FOR LOOP in Apex but is fully declarative. Why Use ListAction? ListAction is commonly used when: You receive multiple records from a DataRaptor or Integration Action You need to process each record individually You want to perform calculations, transformations, or updates on each list item You need to loop data before sending it to OmniScript or FlexCard Common Use Cases of ListAction Loop through a list of Accounts or Cases Perform calculations on each record Build a transformed response structure Update multiple records using DataRaptor Post Prepare formatted output for OmniScript or FlexCard Basic Structure of ListAction A ListAction has three key parts: Input List Loop Processing Elements Output List All actions inside ListAction run once per item in the list. Step 1: Create an Integration Procedure Go to OmniStudio Designer Select Integration Procedures Click New Provide: Name Type (Reusable or not) Save the Integration Procedure In List Action Step 2: Get Data That Returns a List Before using ListAction, you need a list input. Common sources: DataRaptor Extract Integration Action SetValues (array creation) Example: A DataRaptor Extract that returns a list of Accounts: Accounts[]   This list will be used as input for ListAction. In Response Action On the preview tab.  Step 3: Add ListAction to Integration Procedure Drag ListAction into the Structure panel   Place it after the step that returns list data   Rename it (example: Loop_Accounts) In List Action On the preview tab  On preview tab Step 4: Configure ListAction Properties List Input Path Specify the JSON path of the list: Accounts   This tells the Integration Procedure which list to loop through. Loop Variable Define a variable name to represent current record: CurrentAccount   This variable holds one item at a time during iteration. Advanced Merge = true Well Done!!! We got the result in preview tab  On preview tab Step 5: Add Child Actions Inside ListAction Now add elements inside the ListAction. These will execute for each list item. Commonly used actions: SetValues Perform calculations Merge fields Rename attributes Example: CurrentAccount.Name + ‘ – Processed’   DataRaptor Post Update records Insert child records Example: Update Account Status for each record. Integration Action Call external APIs per record Send individual payloads Step 6: Store Output Using ListAction Output To collect results from each iteration: Enable Output List Define Output Path: ProcessedAccounts   Each iteration’s result will be added to this output list. Step 7: Use Response Action to Send Data To return data to OmniScript or FlexCard: Add Response Action Enable Return Full Data JSON (optional) Or return specific node: ProcessedAccounts   This makes the processed list available to the caller. Example Scenario Scenario: You fetch a list of Accounts and want to: Append a label to Account Name Return the modified list to OmniScript Flow: DataRaptor Extract → Accounts[] ListAction → Loop Accounts SetValues → Modify Name Response Action → Send ProcessedAccounts Best Practices for Using ListAction Always validate input list path Keep ListAction logic lightweight Avoid unnecessary nesting Use meaningful loop variable names Return only required data for performance Common Mistakes to Avoid Incorrect List Input Path Using wrong JSON structure Forgetting to store output Returning too much data in Response Action Not testing in Preview tab Testing ListAction Open Integration Procedure Go to Preview Provide sample JSON input Click Execute Verify loop output and response Conclusion ListAction is a powerful feature in Integration Procedures that allows you to process arrays efficiently without Apex. It plays a critical role in data transformation, looping logic, and preparing structured responses for OmniScripts and FlexCards. Mastering ListAction helps you build scalable, high-performance OmniStudio solutions with clean and reusable logic.

How To Use ListAction In Integration Procedures Read More »

How To Use DataRaptorPost In Integration Procedures

In OmniStudio (Vlocity) Salesforce, Integration Procedures (IP) are used to orchestrate data processing without writing Apex. One of the most important actions inside an Integration Procedure is DataRaptorPostAction, which allows you to insert, update, or upsert records in Salesforce using a DataRaptor Load (Post). This post explains what DataRaptor Post is, when to use it, and how to configure it step by step inside an Integration Procedure. What Is DataRaptor Post Action? DataRaptorPostAction is used in an Integration Procedure to send data to Salesforce and perform DML operations, such as: Insert records Update records Upsert records It uses a DataRaptor Load interface, which defines how incoming data maps to Salesforce objects. When Should You Use DataRaptor Post in Integration Procedures? Use DataRaptor Post when: You need to save OmniScript or API data into Salesforce You want to avoid Apex for DML operations You need high performance and bulk-safe processing You are updating records from OmniScript, FlexCard, or API requests Step 1: Create an Integration Procedure Navigate to OmniStudio → Integration Procedures Click New Enter: Name Type (Reusable or Standard) Save the Integration Procedure This Integration Procedure will act as the orchestrator for posting data. Step 2: Add DataRaptorPostAction to the Structure Panel In the Structure panel, drag DataRaptor Post Action Place it at the correct position in the execution flow Rename it for clarity (example: Post_Account_Data) Step 3: Configure DataRaptor Interface In the DataRaptor Interface field: Select the DataRaptor Load (Post) that you want to use This DataRaptor must already be created and activated This interface defines: Which Salesforce object will be updated Which fields will be mapped What operation will be performed (Insert / Update / Upsert) Post Data Raptor Step 4: Configure Additional Input / Output / Failure Response Inside DataRaptorPostAction, scroll to: ADDITIONAL INPUT / OUTPUT / FAILURE RESPONSE Important options: Send Only Additional Input Set to True if you want to send only mapped input Set to False if you want to send full Integration Procedure data Best Practice: Set this to True for better performance and cleaner payloads. Additional Output You can define what response you want back from the DataRaptor, such as: Record Id Success flag Error message Failure Response Configure error handling to capture: Validation errors Required field errors DML exceptions Field mapping for send data in post data raptor Step 5: Configure Field Mapping in DataRaptor Load Now open the DataRaptor Load (Post) used above. Inside DataRaptor Load: Select the Target Object (e.g., Account) Choose the Operation Type: Insert Update Upsert Map source fields to Salesforce fields Field mapping in DataRaptor Load Step 6: Add ResponseAction to Send Data Back To display or return results: Drag ResponseAction into the Structure panel Place it after DataRaptorPostAction Configure: Return Full Data JSON = True OR Return a specific node using %%PostResult%% This allows the Integration Procedure to return: Created/updated record Id Status of the operation Error messages (if any) In Response Acton Step 7: Provide Input Parameters in Preview Tab Go to the Preview tab of the Integration Procedure. Example Input JSON: {   “Name”: “Test Account”,   “Phone”: “1234567890” }   These values must match: The input expected by the DataRaptor Load The field mapping defined earlier Step 8: Execute the Integration Procedure Click Execute Check the response JSON Verify: Record is created or updated in Salesforce Response contains success or error details On Preview Tab Result Common Use Cases of DataRaptor Post in IP Save OmniScript form data Update Account, Contact, Case records Bulk record updates using ListAction + DataRaptor Post API-based data ingestion FlexCard action-based updates Best Practices Always use Send Only Additional Input = True Validate required fields before posting Use ListAction for bulk updates Return minimal response data Handle errors using Failure Response Common Mistakes to Avoid Using incorrect DataRaptor Interface name Missing required fields in input JSON Not activating DataRaptor Load Returning too much data in ResponseAction Skipping error handling Conclusion DataRaptorPostAction is the preferred way to perform create and update operations in OmniStudio Integration Procedures. It provides a declarative, high-performance, and scalable alternative to Apex, making it ideal for OmniScript and FlexCard integrations. Mastering DataRaptor Post helps you build robust, maintainable OmniStudio solutions.

How To Use DataRaptorPost In Integration Procedures Read More »

How to Configure Products in Quote line. (Salesforce CPQ)

Salesforce CPQ (Configure, Price, Quote) allows sales teams to easily add, configure, and price products on a Quote Line. Product configuration is one of the most important features of CPQ because it ensures that the right products, options, and prices are selected according to business rules. In this post, we will understand how products are configured in Quote Lines, what objects are involved, and how configuration works step by step. What Is a Quote Line in Salesforce CPQ? A Quote Line represents a product added to a Quote. Each product added to a Quote creates a corresponding Quote Line record. A Quote Line stores: Product information Quantity Price Configuration details Selected options Pricing adjustments Key Objects Involved in Product Configuration Before configuring products, it is important to understand the main CPQ objects involved: Product Base item that can be sold Can be standalone or configurable Product Option Represents optional or required child products Used only with configurable products Option Group Groups related product options Controls selection behavior (single-select or multi-select) Quote Line Stores the final configuration selected by the user Configuration Attributes Used to pass values between parent and child products Step 1: Create a Configurable Product Go to Products Create or open a Product Set: Configurable = True Active = True Save the product This enables the product to support configuration during quote creation. Step 2: Create Product Options Product Options define which child products can be selected. Go to Product Options Create a new Product Option Fill: Configured Product (Parent Product) Optional Product (Child Product) Required (True/False) Quantity Save the record Each Product Option becomes selectable in the Quote Line Editor. Step 3: Create Option Groups (Optional but Recommended) Option Groups help organize product options logically. Go to Option Groups Create a new Option Group Set: Name Configured Product Type: Select (single) Multi-Select Save Assign Product Options to Option Groups to control selection behavior. Step 4: Define Configuration Rules (If Needed) Configuration Rules enforce business logic. Common use cases: Auto-select options Prevent incompatible selections Require specific options Configuration Rules include: Selection Rules Validation Rules Alert Rules Filter Rules These rules automatically apply during Quote Line configuration. Step 5: Add Product to Quote Open a Quote Click Edit Lines Select the configurable product Click Add Products Click Configure This opens the Quote Line Editor (QLE). Step 6: Configure Product in Quote Line Editor Inside the Quote Line Editor: You can: All selections are stored in Quote Line records. Step 7: Use Configuration Attributes (Advanced) Configuration Attributes allow data sharing between products. Example use cases: Steps: Step 8: Pricing and Calculation on Quote Line Once configuration is complete: Pricing Rules can further adjust pricing dynamically. Step 9: Save Configuration After completing configuration: The configured Quote Line is now ready for approval, PDF generation, or order creation. Common Use Cases Best Practices Common Mistakes to Avoid Conclusion Configuring products in Salesforce CPQ Quote Lines ensures accurate pricing, valid product combinations, and a smooth sales experience. By using configurable products, product options, option groups, and rules correctly, businesses can automate complex sales scenarios without manual intervention.

How to Configure Products in Quote line. (Salesforce CPQ) Read More »

How To Use Edit Block in OmniScript (Vlocity)

Edit Block is one of the most powerful components in OmniScript. It allows users to view, add, and edit multiple records directly on the screen without navigating away or using separate load actions. In this post, we will learn how to use Edit Block in OmniScript Vlocity, how it works internally, and how to configure it step by step. What Is an Edit Block in OmniScript? An Edit Block enables users to add or edit multiple entries in a single array. It is commonly used when you want to edit related records like: Account Contacts Related Addresses Custom child records Edit Blocks are repeatable by default, meaning they can display multiple rows of data dynamically. Edit Blocks also support prefilling data, which means records can be fetched first and then edited directly on the UI. When Should You Use an Edit Block? Use an Edit Block when: You need inline editing of records You want to update records without a Load DataRaptor You want a cleaner, faster user experience You are working with child records in an array format Step 1: Create OmniScript and Fetch Data To edit records, users must first see the records. Step 1.1: Create an OmniScript Create a new OmniScript Activate it after configuration Step 1.2: Fetch Data Using DataRaptor Extract Add an Extract Action Use a DataRaptor Extract to fetch records Ensure the response is returned as an array This extracted data will later be bound to the Edit Block. Step 2: Add and Configure the Edit Block Step 2.1: Add Edit Block Drag an Edit Block into the OmniScript canvas Step 2.2: Bind Edit Block to Extract Data Edit Block Name must match the Extract JSON Path This binding is mandatory for data to display correctly Example: Extract JSON Path: Contacts Edit Block Name: Contacts This is how OmniScript knows which data belongs to the Edit Block. Step 3: Add Editable Fields Inside Edit Block Inside the Edit Block: Add Text, Input, or other form elements Each element name must exactly match the field name coming from DataRaptor Example: Field from DataRaptor: FirstName Element Name: FirstName This name matching binds data automatically. Step 4: Configure Remote Action for Edit Block To update records without a Load Action, a Remote Action is required. Step 4.1: Add Remote Action Inside Edit Block Drag a Remote Action inside the Edit Block Step 4.2: Configure Remote Action Properties Remote Class: DefaultOmniScriptEditBlock Remote Method: edit This standard Salesforce class handles record updates automatically. Step 5: Configure SObject Mapping Correct mapping ensures records are updated in Salesforce. Required Configurations: Set SObject Name Map fields correctly in SObject Field Mappings Map: Edit Block element Id → SObject field Id Important rules: Id field must be: Marked as Duplicate Key Hidden from the UI This ensures correct record identification. Step 6: Enable Edit Functionality In Edit Block Properties: Enable Allow Edit Set Edit Label (for example: “Edit”) The Edit Label must match the Remote Action Name exactly. This connects the UI edit button with the backend update logic. Step 7: Configure Elements Inside Edit Block Select all elements that should be editable Mark them under Elements Inside Edit Block This controls what fields appear when editing starts Step 8: Test the Edit Block Preview the OmniScript: Records appear in repeatable rows Click Edit Modify values Save updates Changes are saved directly to Salesforce without using a Load DataRaptor. Key Points to Remember Edit Block Name must match Extract JSON Path Field names must match exactly Remote Action is mandatory Id field mapping is required No Load Action is needed Common Mistakes to Avoid Mismatched JSON Path and Edit Block Name Forgetting to add Remote Action Incorrect Id mapping Not enabling Allow Edit Using Load Action unnecessarily Conclusion Edit Blocks in OmniScript provide a powerful and efficient way to manage multiple records directly on the UI. When configured correctly, they eliminate the need for additional load actions and significantly improve performance and user experience. Edit Blocks are especially useful in complex OmniStudio implementations where inline record updates are required.

How To Use Edit Block in OmniScript (Vlocity) Read More »

Scroll to Top