For the complete documentation index, see llms.txt. This page is also available as Markdown.

Advanced Data: Formula Builder

Formula variables allow you to evaluate complex logic, perform calculations, and render dynamic values directly within your document templates using standard Salesforce operators and functions.

Before You Begin

Open your target document template inside the S-Docs template builder.

Creating a Formula Variable

Advanced Variables Panel
Configure Formula Panel
  1. Navigate to the main variables panel and select the Advanced Variables icon located at the top of the panel.

  2. In the right-side drawer, select Formulas.

  3. Select Click to add under the Formulas section to launch the configuration panel.

  4. Enter a custom name for your variable in the Label field.

  5. Select a data type from the Return Type dropdown menu. String is selected by default. Available options include:

    • String

    • Checkbox

    • Currency

    • Date

    • Date Time

    • Decimal

    • Integer

    • Percent

    • Time

  6. Click Configure Formula to open the formula builder.

  1. Build your expression using standard object fields, operators, and functions:

    • Click Insert Field to search or select fields from the current object record.

    • Select standard Salesforce operators from the Operators dropdown menu.

    • Choose functions from categories including math, text, date and time, logical, and advanced.

  2. Select Validate to verify your formula syntax is correct.

  1. Click Confirm once the formula is validated.

  2. Click Add Formula in the configuration panel to save the item to your library.

Inserting a Formula Variable Into a Template

Once created, formula variables appear in the main variables panel under the Formulas category. They are grouped by their assigned return type — such as text, date, or time — and function identically to standard variables.

  • Open the main variables panel and navigate to the Formulas category.

  • Select and insert your formula variable into the template body.

Upon document generation, S-Docs evaluates your formula logic and automatically renders the output.

Last updated

Was this helpful?