---
title: SINGLE_FOR_FORMULA
description: "Need calculations, summations, averages, ... and you do not want to add Formula fields in Salesforce. Use the SINGLE_FOR_FORMULA [Academy SINGLE FOR FORMULA ConfigType](https://www.youtube.com/embed/yzoHN5TRCYc?si=xSkTVhHjqymLHv36) ## **1. Initial Setup** Before configuring formulas, complete the basic setup: 1. Create a **Doc Config**.…"
url: "https://pdfbutler.com/academy/pdf-butler-academy/pdf-butler-by-configtype/single_for_formula/"
updated: "2026-05-05"
category: PDF BUTLER BY CONFIGTYPE
---

# SINGLE_FOR_FORMULA

Need calculations, summations, averages, ... and you do not want to add Formula fields in Salesforce. Use the SINGLE_FOR_FORMULA

[Academy SINGLE FOR FORMULA ConfigType](https://www.youtube.com/embed/yzoHN5TRCYc?si=xSkTVhHjqymLHv36)

## **1. Initial Setup**

Before configuring formulas, complete the basic setup:

1. Create a **Doc Config**.
    ![](https://pdfbutler.com/wp-content/uploads/2023/08/1-3-300x145.jpg)
2. Create the required **Data Sources**.
    ![](https://pdfbutler.com/wp-content/uploads/2023/08/2-2-300x146.png)
   ![](https://pdfbutler.com/wp-content/uploads/2023/08/3-3-300x146.png)
3. Open the **PDF Butler Editor**.
4. Add the **Data Sources** to the configuration.
5. Upload your **document template**.
    ![](https://pdfbutler.com/wp-content/uploads/2023/08/4-300x146.png)

---

## **2. Using the Formula Editor**

### **Enable Form Fields**

1. Go to **Doc Config Metadata**.
2. Enable **Form Fields**.
    ![](https://pdfbutler.com/wp-content/uploads/2023/08/5-3-300x86.png)

---

### **Create a Formula Config Type**

1. Click **Add Config Type**.
2. Select **SINGLE_FOR_FORMULA** as the type.
3. Set the **Format Type** to **Currency**.
4. Define the field to be formatted.
5. Enter the **Merge Field** (e.g., `TotalOppAmount`).
6. Click **Open Formula Editor**.
    ![](https://pdfbutler.com/wp-content/uploads/2023/08/6-2-300x243.png)

---

### **Build the Formula**

1. In the Formula Editor, drag and drop:
   - Data sources
   - Fields required for the calculation
2. Define your formula logic using the selected fields.
    ![](https://pdfbutler.com/wp-content/uploads/2023/08/7-3-300x108.png)
3. Click **Save to Server**.

---

### **Validate the Formula**

1. Navigate to the related record (e.g., **Account** or **Opportunity**).
2. Generate the document.
3. Verify that the calculated value is displayed correctly.
    ![](https://pdfbutler.com/wp-content/uploads/2023/08/8-3-300x222.jpg)

---

## **3. Creating Formulas in Table Rows**

To apply formulas within a table structure:

1. Create a **Config Type** of type [**Table Row**](https://pdfbutler.com/academy/pdf-butler-academy/pdf-butler-by-configtype/table_row/).
2. Add a **Child Config Type**.
3. Select **SINGLE_FOR_FORMULA** as the type.
4. Open the **Formula Editor**.
5. Define:
   - Fields to be used
   - Mathematical calculation logic
      ![](https://pdfbutler.com/wp-content/uploads/2023/08/9-3-300x56.png)
      ![](https://pdfbutler.com/wp-content/uploads/2023/08/10-3-300x30.png)
6. Save the configuration.
7. Generate the document to validate the result.
    ![](https://pdfbutler.com/wp-content/uploads/2023/08/12-3-300x249.png)
