---
title: Macro expressions
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Macros are text expressions that the system evaluates and converts into values. By using macros, you can create dynamic content (for example in emails) and in general configure the application to perform different actions under different conditions. Macros range from simple expressions for loading values from data in the system, to complex sets of instructions that lead to a certain result.

> **Info:**&#x20;
>
> #### [Learn the macro syntax](https://docs.kentico.com/13/macro-expressions/macro-syntax.md)
>
> Xperience uses a macro language (K#) with a wide range of syntax options and features.

> **Info:**&#x20;
>
> #### [Enter macro expressions in the system](https://docs.kentico.com/13/macro-expressions/entering-macro-expressions.md)
>
> Learn where in the Xperience administration interface you can enter macro expressions, and about the available assistance features.

> **Info:**&#x20;
>
> #### [Write macro conditions](https://docs.kentico.com/13/macro-expressions/writing-macro-conditions.md)
>
> One of the most common ways to leverage macros is to define dynamic conditions for various types of functionality.
>
> - [Build conditions using a text-based interface (macro rules)](https://docs.kentico.com/13/macro-expressions/writing-macro-conditions/building-conditions-using-macro-rules.md)
> - [Create custom macro rules](https://docs.kentico.com/13/macro-expressions/writing-macro-conditions/creating-macro-rules.md)

> **Info:**&#x20;
>
> #### [Find information about macro methods](https://docs.kentico.com/13/macro-expressions/reference-macro-methods.md)
>
> The system provides a large number of methods that you can call in macro expressions. View this reference to learn about the available methods.

> **Info:**&#x20;
>
> #### [Troubleshoot macros](https://docs.kentico.com/13/macro-expressions/troubleshooting-macros.md)
>
> If you encounter problems when working with macro expressions, the system provides several tools that can help identify and fix the issues:
>
> - [Search the system for macro expressions](https://docs.kentico.com/13/macro-expressions/troubleshooting-macros/searching-for-macros.md)
> - [Debug macros](https://docs.kentico.com/13/macro-expressions/troubleshooting-macros/debugging-macros.md)
> - [Solve problems with macro signatures](https://docs.kentico.com/13/macro-expressions/troubleshooting-macros/working-with-macro-signatures.md)

> **Info:**&#x20;
>
> #### [Extend the macro engine](https://docs.kentico.com/13/macro-expressions/extending-the-macro-engine.md)
>
> If the default functionality of the macro engine does not cover all of your requirements, developers can extend the macro engine.
>
> Learn to create custom:
>
> - [Macro methods](https://docs.kentico.com/13/macro-expressions/extending-the-macro-engine/registering-custom-macro-methods.md)
> - [Macro fields (properties)](https://docs.kentico.com/13/macro-expressions/extending-the-macro-engine/adding-custom-macro-fields.md)
> - [Macro namespaces](https://docs.kentico.com/13/macro-expressions/extending-the-macro-engine/creating-macro-namespaces.md)

## Macro expressions on the live site

Usage of macros is fully supported for the Xperience administration interface and for all processes that run within the administration application, such as [marketing automation](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/marketing-automation.md) processes, recalculation of [contact scores](https://docs.kentico.com/13/on-line-marketing-features/managing-your-on-line-marketing-features/contact-management/scoring-contacts.md), and most [scheduled tasks](https://docs.kentico.com/13/configuring-xperience/scheduling-tasks.md).

However, macros are not automatically resolved within text fields when [displaying page content](https://docs.kentico.com/13/developing-websites/retrieving-content/displaying-page-content.md) on the live site. If you wish to use macros within page content, you need to manually resolve the [macros using the API](https://docs.kentico.com/13/macro-expressions/resolving-macros-using-the-api.md) before you render the data on the live site.
