# Component Template How-to Article

{% stepper %}
{% step %}

#### Create a new S-Docs template

{% endstep %}

{% step %}

#### Set **Template Format** to `Component`

{% hint style="info" %}
If `Component` does not appear in the Template Format picklist, you can manually add it:

Setup → Object Manager → SDoc Template → Fields & Relationships → Template Format → Values
{% endhint %}
{% endstep %}

{% step %}

#### Build the component like a normal S-Docs template

{% hint style="warning" %}
Important limitations:

* No Header/Footer tab
* No Page Settings
* No Email or Output configuration\
  (All of these are controlled by the parent template)
  {% endhint %}
  {% endstep %}
  {% endstepper %}

{% hint style="info" %}
Looking to start new?

Start with the [Component Templates Tutorial](broken://spaces/WKNnJmhJBQwhdk5WBFsi/pages/MmgMvojS6jMquOp1eOBS).
{% endhint %}

### How to Include a Component in a Parent Template

#### Using the Insert Field Tool within the template editor

1. Open your parent template
2. Place your cursor where the component should appear
3. Click **Insert Field**
4. Go to the **Other Templates** tab
5. Select your component and click **Insert**

This method works best when the component and parent share the same base object.

#### Using Merge Field Syntax Directly

PDF-based templates:

```
{{{{!My Component Template}}}}
```

DOCX templates:

```
[{{{{!My Component Template}}}}]
```

### More component topics

<table data-column-title-hidden data-view="cards"><thead><tr><th>Title</th><th>Description</th><th data-card-target data-type="content-ref">Target</th></tr></thead><tbody><tr><td>Component (DOCX)</td><td>Use DOCX component templates in DOCX parent templates.</td><td><a href="/spaces/WKNnJmhJBQwhdk5WBFsi/pages/FvhSrt3zWGMV9LhaAC7e">/spaces/WKNnJmhJBQwhdk5WBFsi/pages/FvhSrt3zWGMV9LhaAC7e</a></td></tr><tr><td>PDF-Upload as a Component</td><td>Merge PDF-Upload templates into supported parent templates.</td><td><a href="/spaces/WKNnJmhJBQwhdk5WBFsi/pages/Q59JbcKYVMQUMpYgf3mg">/spaces/WKNnJmhJBQwhdk5WBFsi/pages/Q59JbcKYVMQUMpYgf3mg</a></td></tr><tr><td>Using Component Queries</td><td>Repeat a component once per record returned by a SOQL query.</td><td><a href="/spaces/WKNnJmhJBQwhdk5WBFsi/pages/bqedg0818Y4z3baQzGBH">/spaces/WKNnJmhJBQwhdk5WBFsi/pages/bqedg0818Y4z3baQzGBH</a></td></tr><tr><td>Combining Components with Render Logic</td><td>Use conditional logic inside component templates.</td><td><a href="/spaces/WKNnJmhJBQwhdk5WBFsi/pages/9cBRZdRlwbX5nsy07RC1">/spaces/WKNnJmhJBQwhdk5WBFsi/pages/9cBRZdRlwbX5nsy07RC1</a></td></tr><tr><td>Dynamic Components</td><td>Choose which component to render at runtime based on Salesforce data.</td><td><a href="/spaces/WKNnJmhJBQwhdk5WBFsi/pages/tnAMcJihlL3EdmCpKs0m">/spaces/WKNnJmhJBQwhdk5WBFsi/pages/tnAMcJihlL3EdmCpKs0m</a></td></tr></tbody></table>


---

# 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/advanced-template-logic/build-reusable-templates/component-template-how-to-article.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.
