# Insert Data Tables

Use this section when you need repeating data tables in an S-Docs template.

In S-Docs, most tables are built with **related lists** powered by **direct SOQL**.

Use this section to choose the right path for row selection, output formatting, Microsoft template layout, and troubleshooting.

{% hint style="info" %}
The query logic stays the same across formats. Microsoft templates use a different table wrapper around the same related list pattern.
{% endhint %}

### Start with the path that fits your goal

If you need to return the right rows, start with filtering and sorting.

If the query already works, move to formatting, summaries, and cleaner output.

If you are building DOCX, or PPTX output, use the [Microsoft template guide](/sdocs/advanced-template-logic/related-lists/how-to-create-a-table-in-microsoft-templates-docx-pptx.md).

<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><strong>Getting Started with Related Lists</strong></td><td>Learn the core related list pattern, then build your first repeating table.</td><td><a href="/spaces/v7v0UNK83URKB2C83QVU/pages/jwVZ8tb5oYeyhNIHedyt">/spaces/v7v0UNK83URKB2C83QVU/pages/jwVZ8tb5oYeyhNIHedyt</a></td></tr><tr><td><strong>Filter and Sort a Related List</strong></td><td>Use WHERE, ORDER BY, LIMIT, and relationship fields to return the right rows.</td><td><a href="/pages/uz1Os9YiuXMi8dW5A0aj">/pages/uz1Os9YiuXMi8dW5A0aj</a></td></tr><tr><td><strong>Related List Reference</strong></td><td>Use the reference when you need structure, syntax, and deeper examples.</td><td><a href="/spaces/qNhwNwsut3uqS2daHMHX/pages/UeEi28GEK2Zxiz17sM3T">/spaces/qNhwNwsut3uqS2daHMHX/pages/UeEi28GEK2Zxiz17sM3T</a></td></tr></tbody></table>

### What you can do with data tables

* Extract child records into repeated rows.
* Filter, sort, and limit records using direct SOQL.
* Format dates, currency, and handle blank values in table output.
* Create grouped summaries and calculate aggregate totals.
* Render repeating tables in PDF and Microsoft templates.

### Browse by topic

* [Related List How-To Guides](/sdocs/advanced-template-logic/related-lists/how-to-filter-and-sort-a-related-list.md)
* [How to: Filter and Sort a Related List](/sdocs/advanced-template-logic/related-lists/how-to-filter-and-sort-a-related-list.md)
* [How to: Format and Summarize a Related List](/sdocs/advanced-template-logic/related-lists/how-to-format-and-summarize-a-related-list.md)
* [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)
* [Additional Troubleshooting](/sdocs/advanced-template-logic/related-lists/additional-troubleshooting.md)

### Related note

Use [Retrieve and Reuse Data](/sdocs/advanced-template-logic/named-query.md) when you need query results in a sentence, header, footer, or calculation instead of a 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/related-lists.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.
