---
schema_version: "1"
id: be5b011b091c13cd350f99fb1682b55856fcbe87575adecc2f3a378ab4d77676
title: Rules Files Structure
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_wave_templates/guides/concept/bi-templatesdev-rules-files-structure.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-rules-files-structure.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: aea08981694651ea06157c25839b2f68aa086048576cf049eede871d84a286f3
products:
  - Analytics Templates Developer Guide
  - analytics
---

# Rules Files Structure

Rules files can contain three sections: rules, constants, and macros.

- Rules. This is where you define the rules followed by the template for creating the app.
- Constants. Use constants to create shortcuts for longer expressions. Constants are like variables, but are not passed in or declared in the UI. Constants can be referenced in the document via the normal expression language `${Constants.<constantName>}`.
- Macros. Rule macros let you define repeatable, well-tested rule code units that can be called within the context of any JSON transformation, simplifying and making the rule definition source easier to maintain
