# Build and Upload a PPTX Template

Use this page when you want slide-native design in Microsoft PowerPoint and a generated `.pptx` output from Salesforce data.

A PPTX template is built in PowerPoint, then uploaded to S-Docs for generation.

Use PPTX when slide design matters more than HTML layout or Word editing.

{% hint style="info" %}
Pick **PPTX** when you need presentation-style output, PowerPoint design tools, and bracket-based S-Docs syntax.

Pick [Microsoft Word (DOCX)](/sdocs/template-architecture/document-formats/docx-s-docs.md) when users need to keep editing the final document in Word.
{% endhint %}

### Before you start

Make sure you have:

* a new S-Docs template with format set to **PPTX**
* the correct **Related To Type** for your base record
* a `.pptx` file you can edit in Microsoft PowerPoint
* the right upload path for your S-Docs version

PPTX upload behavior depends on whether **Enable New Microsoft Template Upload** is checked.

* **Checked** — use the newer Microsoft template upload flow. This applies to Summer 2025 (`v10.0`) and later. These templates generate through **S-Docs LWCs** or the **SDK**.
* **Not checked** — use the legacy upload flow in **Template Editor**. These templates generate through the legacy custom S-Docs button.

{% hint style="warning" %}
The upload path and generation path must match.

A valid PPTX file can still fail if it was uploaded in one mode and generated in the other.
{% endhint %}

### Build and upload a PPTX template

{% stepper %}
{% step %}

### Create the template record

Create a new S-Docs template.

Set **Template Format** to `PPTX`.
{% endstep %}

{% step %}

### Build the slide deck in Microsoft PowerPoint

Create the slide layout in PowerPoint exactly as you want it to appear.

Use normal PowerPoint tools for text, shapes, images, alignment, and tables.
{% endstep %}

{% step %}

### Add S-Docs merge syntax

Insert merge fields, render blocks, and query output using bracketed Microsoft template syntax.

{% code title="pptx-basic-syntax.txt" %}

```plaintext
[{{!Opportunity.Name}}]

[<!--RENDER='{{!Opportunity.StageName}}' == 'Closed Won' -->]
  Closed-won summary slide content
[<!--ENDRENDER-->]
```

{% endcode %}

<figure><img src="/spaces/WKNnJmhJBQwhdk5WBFsi/files/7MceiIaWsGbk3evGZbNt" alt="PPTX merge field wrapped in square brackets" width="375"><figcaption><p>Wrap PPTX merge fields in square brackets.</p></figcaption></figure>
{% endstep %}

{% step %}

### Add table-based repeating data when needed

If you need a related list, build it inside a PowerPoint table.

Your PowerPoint table needs:

1. a header row
2. an odd row with placeholder text
3. an even row with placeholder text

Use the Microsoft template wrapper around that table.
{% endstep %}

{% step %}

### Upload the `.pptx` file

If **Enable New Microsoft Template Upload** is checked, upload the file through the newer Microsoft template upload flow.

If it is not checked, upload the file in **Template Editor**.
{% endstep %}

{% step %}

### Generate and test with real data

Test the template with real Salesforce records.

Verify merge fields, slide overflow, images, related list output, and conditional sections before rollout.
{% endstep %}
{% endstepper %}

### Core PPTX syntax patterns

#### Merge fields

Wrap merge fields in square brackets.

{% code title="pptx-merge-fields.txt" %}

```plaintext
[{{!Account.Name}}]
[{{!Opportunity.Amount #,###.00}}]
```

{% endcode %}

Use this same pattern for standard field paths too.

{% code title="pptx-merge-field-paths.txt" %}

```plaintext
[{{!Opportunity.Name}}]
[{{!Opportunity.Account.Name}}]
[{{!Contact.Email}}]
```

{% endcode %}

#### Conditional logic

Wrap both `RENDER` tags in square brackets.

{% code title="pptx-render-block.txt" %}

```plaintext
[<!--RENDER='{{!Contact.Phone}}' != 'NULL' -->]
  Phone: [{{!Contact.Phone}}]
[<!--ENDRENDER-->]
```

{% endcode %}

Keep merge fields inside rendered content in square brackets too.

Use the same operators you use in standard conditional logic.

{% code title="pptx-render-operators.txt" %}

```plaintext
[<!--RENDER=( ('{{!Account.BillingState}}' == 'CA' || '{{!Account.BillingState}}' == 'NV')
             && '{{!Account.Active_Contract__c}}' == 'True' ) -->]
  Regional account with active contract
[<!--ENDRENDER-->]
```

{% endcode %}

Nested render blocks work too.

{% code title="pptx-render-nested.txt" %}

```plaintext
[<!--RENDER='{{!Opportunity.StageName}}' == 'Closed Won' -->]
  Congratulations on your purchase.
  [<!--RENDER1='{{!Opportunity.Install_Date__c}}' != 'NULL' -->]
    Installation is scheduled for [{{!Opportunity.Install_Date__c}}].
  [<!--ENDRENDER1-->]
[<!--ENDRENDER-->]
```

{% endcode %}

#### Named queries

Wrap both the query block and output fields in square brackets.

{% code title="pptx-named-query.txt" %}

```plaintext
[{{!<lineitemsSOQL>
  <class>none</class>
  <queryname>TopItem</queryname>
  <soql>
    SELECT Name, TotalPrice
    FROM OpportunityLineItem
    WHERE OpportunityId = '{{!Opportunity.Id}}'
    ORDER BY TotalPrice DESC
    LIMIT 1
  </soql>
</lineitemsSOQL>}}]

[{{!TopItem.Name}}]
[{{!TopItem.TotalPrice #,###.00}}]
```

{% endcode %}

<figure><img src="/spaces/WKNnJmhJBQwhdk5WBFsi/files/LQjAT9DU3taUhhYqbBCa" alt="PPTX named query output fields wrapped in square brackets"><figcaption><p>Wrap named query output fields in square brackets too.</p></figcaption></figure>

If you need a filtered or offset result, keep the same square-bracket wrapping.

{% code title="pptx-named-query-filter-offset.txt" %}

```plaintext
[{{!<lineitemsSOQL>
  <class>none</class>
  <queryname>FilteredItems</queryname>
  <soql>
    SELECT Name, TotalPrice
    FROM OpportunityLineItem
    WHERE OpportunityId = '{{!Opportunity.Id}}'
    ORDER BY TotalPrice DESC
  </soql>
  <filter id="1">TotalPrice >= 1000</filter>
</lineitemsSOQL>}}]

[{{!FilteredItems.Name filter="1" offset="1"}}]
[{{!FilteredItems.TotalPrice filter="1" offset="1" #,###.00}}]
```

{% endcode %}

#### Related list tables

PPTX related lists render inside PowerPoint tables.

Use the same table wrapper pattern used in Microsoft templates.

<figure><img src="/spaces/WKNnJmhJBQwhdk5WBFsi/files/4TcTAhxk9MQ4aqKJHpOe" alt="PowerPoint table with header, odd row, and even row"><figcaption><p>Build the PowerPoint table with a header row, an odd row, and an even row.</p></figcaption></figure>

{% code title="pptx-related-list-table.txt" %}

```plaintext
[{{!<lineitemsSOQL>
<tableformat>]

| Product | Quantity | Total |
| sample  | sample   | sample |
| sample  | sample   | sample |

[</tableformat>
<soql>
  SELECT Product2.Name, Quantity, TotalPrice
  FROM OpportunityLineItem
  WHERE OpportunityId = '{{!Opportunity.Id}}'
  ORDER BY SortOrder
</soql>
<column>Product2.Name</column>
<column>Quantity</column>
<column format-number="#,##0.00" prefix="$">TotalPrice</column>
</lineitemsSOQL>}}]
```

{% endcode %}

Use this structure exactly:

1. Put the opening block before the PowerPoint table.
2. Keep the table inside the `tableformat` wrapper.
3. Put the query and `<column>` tags after the table.
4. Make sure each `<column>` matches a field returned in `SELECT`.

{% hint style="info" %}
For PPTX syntax, four rules matter most:

* merge fields use square brackets
* named query output fields use square brackets
* `RENDER` blocks use square brackets
* merge fields inside rendered content also use square brackets
  {% endhint %}

### Common syntax mistakes

* **Field prints as text:** add square brackets around the merge field
* **Conditional block does not run:** wrap both opening and closing `RENDER` tags in square brackets
* **Named query returns nothing:** confirm the output field is wrapped in square brackets and included in `SELECT`
* **Related list table breaks:** confirm the table has a header row, an odd row, and an even row
* **Only the first table cell populates:** recreate the PowerPoint table and simplify table styling

### What PPTX supports

PPTX templates support these common S-Docs capabilities:

* merge fields
* conditional logic
* named queries
* related list tables
* images and slide-native PowerPoint formatting
* generation through **S-Docs LWCs** and the **SDK** when uploaded through the newer Microsoft template upload flow

### Important PPTX limitations

Keep these PPTX-specific rules in mind:

* Live Edit is not supported.
* Template headers and footers are not supported.
* Component templates are not supported.
* S-Sign is not supported.
* Related list tables cannot span multiple pages or slides.
* You may need `LIMIT` and `OFFSET` to control table size.
* Templates uploaded through the legacy Template Editor have an approximate limit of **10 slides**.

{% hint style="warning" %}
If a related list only fills the first cell or behaves unpredictably, rebuild the PowerPoint table from scratch and simplify table styling first.
{% endhint %}

### Next reads by goal

* Need a PPTX overview? Read [PowerPoint (PPTX)](/sdocs/template-architecture/document-formats/pptx-format.md).
* Need PPTX troubleshooting? Read [Troubleshoot PPTX Generation](broken://spaces/WKNnJmhJBQwhdk5WBFsi/pages/oHOjBkHQcTceCbxsE9iL).
* Need table wrapper syntax? Read [Related List Structure In Microsoft Templates (DOCX, PPTX, XLSX)](broken://spaces/WKNnJmhJBQwhdk5WBFsi/pages/47d7aeb4bb2b144961088cfdf431dc82e5549990).
* Need table setup examples? Read [How to: Create a Table In Microsoft Templates (DOCX, PPTX, XLSX)](/sdocs/advanced-template-logic/related-lists/how-to-create-a-table-in-microsoft-templates-docx-pptx.md).
* Need conditional syntax? Read [Conditional Logic In Microsoft Templates (DOCX, PPTX, XLSX)](broken://spaces/WKNnJmhJBQwhdk5WBFsi/pages/Tm6hjFlwwkYPXtXjpGbi).
* Need named query syntax? Read [Named Queries In Microsoft Templates (DOCX, PPTX, XLSX)](broken://spaces/WKNnJmhJBQwhdk5WBFsi/pages/aqrFMMmbfsrmI8OD34jb).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/sdocs/template-architecture/document-formats/pptx-format/build-and-upload-a-pptx-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
