Loading
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Work with Formulas in Edit Block

          Work with Formulas in Edit Block

          Perform equations and combine strings by using Formula Elements. Place formulas within an Edit Block to access element values within a specific Edit Block entry. Place Formula outside of the Edit Block in the same Step to access an element value for all of the Edit Block entries.

          1. Add a Formula element to the Edit Block.
          2. Using the merge field syntax, add the Edit Block's Element Name and the Element Name for the element you want to access in the Formula. For example, %EditBlock:FirstName%. For more information on merge fields, see Access Omniscript Data JSON with Merge Fields.
          3. Add a |n after the Edit Block element name to set the formula to only access the merge field's value for its instance. Using the |n syntax is necessary because the Edit Block stores entry values in an array format. The resulting syntax is %EditBlock|n:FirstName%.
          4. Concatenate values by combining them using the |n syntax. For example, %EditBlock|n:FirstName% + " " + %EditBlock|n:LastName%.
            image

          You can easily validate the Edit Blocks by using formulas. For example, EditBlock1 has fields Name, Xfield, Yfield, and sizefield.

          To validate EditBlock1, use these formulas:

          • Number of rows in EditBlock1: COUNT(%EditBlock1%)
          • Verify if there's a row with value X = Test: IF(CONTAINS(%EditBlock1:Xfield%, "Test"),true,false)
          • Verify if all Y columns are null: IF(%EditBlock1:Yfield%==NULL,true,false)
          • Total sum of sizefield: SUM(%EditBlock1:sizefield%)
          Note
          Note

          When working with validations, formulas, or messaging elements in Omniscripts, always use the |n notation to reference fields in Edit and Repeat blocks. Without it, only the first row is evaluated.

          For example, instead of:

          %ChildList:RadioChildCitzPick% ==
                  %ChildList:RadioChildRelParPick%

          use:

          %ChildList|n:RadioChildCitzPick% ==
                  %ChildList|n:RadioChildRelParPick%

          This ensures the validation checks the current row, not just the first one, preventing incorrect results.

          Access Index of an Edit Block Array in a Formula

          Access each index of an Edit Block array in a formula.

          1. Place a Formula outside of the Edit Block.
          2. In the Formula editor, add the Element Name using the merge field syntax. For example, to return the sum of all the entries for a Number element in an Edit Block, you would use the following syntax in the formula editor: SUM(%EditBlock1:NetIncome%), where NetIncome is the name of a Number element.
          3. (Optional) When using the vlcEditBlockFS.html template, display the formula at the top of the Edit Block by adding the Formula element's name to the Edit Block's Sum Element property.
           
          Loading
          Salesforce Help | Article