# Named Query Reference

Use this section when you need exact syntax for named queries.

These reference pages help you define reusable query blocks, understand merge field patterns, work through advanced retrieval patterns, and start from working examples.

{% hint style="info" %}
If you need a first walkthrough, start with [Creating Your First Named Query (Tutorial)](broken://spaces/WKNnJmhJBQwhdk5WBFsi/pages/vyh6YXRukMRCqXK1Qzlo).

If you already have a query block and need exact syntax, stay in this reference set.
{% endhint %}

{% hint style="success" %}
**Recommended flow**

If you are new to named query syntax, read these pages in order:

1. [Named Query Structure](/developer-hub/template-configuration-and-styling/reference-named-query-syntax/named-query-structure.md)
2. [Named Queries in DOCX and PPTX](/developer-hub/template-configuration-and-styling/reference-named-query-syntax/named-queries-in-microsoft-templates-docx-pptx-xlsx.md)
3. [Named Query Working Examples](/developer-hub/template-configuration-and-styling/reference-named-query-syntax/named-query-working-examples.md)
4. [How to: Advanced Data Retrieval with Named Queries](https://github.com/kvantiem-sdocs/Developer-Hub-Documentation/blob/main/advanced-template-logic/named-query/how-to-advanced-data-retrieval-with-named-queries.md)

Use [Introduction to SOQL](/developer-hub/template-configuration-and-styling/related-list-references/introduction-to-soql.md) if the query itself is the blocker.

Start here when you want the fastest path from syntax to working output.
{% endhint %}

Start with one of these five reference paths:

<table data-card-size="large" 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>Named Query Structure</strong></td><td>Learn the required tags and merge field pattern.</td><td><a href="/pages/K67auasF3ydkLWPnEDGD">/pages/K67auasF3ydkLWPnEDGD</a></td></tr><tr><td><strong>Named Queries in DOCX and PPTX</strong></td><td>Use square-bracket syntax for named query blocks and merge fields in DOCX and PPTX templates.</td><td><a href="/pages/TDNDehx4Hlu8thWvNJnA">/pages/TDNDehx4Hlu8thWvNJnA</a></td></tr><tr><td><strong>Named Query Working Examples</strong></td><td>Start from copy-paste examples for aggregates, filters, and offsets.</td><td><a href="/pages/DepXHpjK4VX855SoDSWP">/pages/DepXHpjK4VX855SoDSWP</a></td></tr><tr><td><strong>Advanced Data Retrieval</strong></td><td>Learn how to combine filters, offsets, aggregates, and grouped-result patterns.</td><td><a href="https://github.com/kvantiem-sdocs/Developer-Hub-Documentation/blob/main/advanced-template-logic/named-query/how-to-advanced-data-retrieval-with-named-queries.md">https://github.com/kvantiem-sdocs/Developer-Hub-Documentation/blob/main/advanced-template-logic/named-query/how-to-advanced-data-retrieval-with-named-queries.md</a></td></tr><tr><td><strong>Introduction to SOQL</strong></td><td>Review `SELECT`, `WHERE`, `ORDER BY`, `LIMIT`, aggregates, and relationship queries.</td><td><a href="/pages/BOKNYv780LQteY5YBeYV">/pages/BOKNYv780LQteY5YBeYV</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/developer-hub/template-configuration-and-styling/reference-named-query-syntax.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.
