---
schema_version: "1"
id: 93288b5b72e99b2bcf918359ea75da152168900b69b95ed8c59b818108be6018
title: Structuring and Organizing Rules
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-structure.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-rules-structure.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8a9c5507b3fcb85e2938bc1413561f2d5539d9328ed8a106c441a08bd9c55d8a
products:
  - Analytics Templates Developer Guide
  - analytics
---

# Structuring and Organizing Rules

The rules section of `template-to-app-rules.json` defines the rules followed by the template.

The section is made up of three parts:

- Action: Designates the operation to perform.
- Path: Defines the path to the location where the action is performed.
- AppliesTo: Determines the asset files to apply the rules to. Consists of a name.

Rules can be divided into multiple files, which are executed in the order in which you list them in `template-info.json`. Be sure that a rule that runs first doesn’t refer to a constant referenced in a rule that runs later.

Here are a few guidelines to consider when working with multiple rules files:

- One rules file can contain all constants, another all actions.
- Use multiple rules when actions grow to 500 lines. You could divide them into a rules file for dashboards, another for datasets or the dataflow.
- If you have content to be used by many rules, include it in the first rules file to be executed.

Here is a simple example, a rule for changing the title text on a dashboard:

```nolang
{
    "name": "Update dashboard title",
    "appliesTo": [
        {
            "type": "dashboard",
            "name": "DashboardOne"
        }
    ],
    "actions": [
        {
            "action": "set",
            "description": "change the title text of the dashboard",
            "path": "$.state.widgets.title_text.parameters.text",
            "value": "${Variables.DashboardTitle}"
        }
    ]
}
```

Make rules more powerful using functions. See [Use Functions in Rules](https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/reference/bi-templatesdev-functions.md).
