---
schema_version: "1"
id: 02848f92492720fb3ec4b2e173a780f841eaaa26f91a4e1d769de8c0779e4c9b
title: Rules Syntax
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_wave_templates/guides/reference/bi-templatesdev-rules-syntax.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-wave-templates/guide/bi-templatesdev-rules-syntax.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 84897d23f193da32e53ca51ba4f18bfb1d946a18fe200253ba903fda2b15e8ec
products:
  - Analytics Templates Developer Guide
  - analytics
---

# Rules Syntax

The rules object may contain any number of rule objects. A rule object is made up of:

| Attribute   | Type   | Example                                    | Required | Notes                                                                                                                                                                                                                                                                                                                                               |
| ----------- | ------ | ------------------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`      | String | `"name": "ruleName"`                       | Yes      |                                                                                                                                                                                                                                                                                                                                                     |
| `condition` | String | `"condition": "${Variables.foo == "Yes"}"` | No       | Use freemarker conditions to apply the rule (same syntax as conditions used in `template-info.json`)                                                                                                                                                                                                                                                |
| `appliesTo` | Array  |                                            | Yes      | Use `"type": "*"` to apply to all JSON assets. Other valid values are `"dashboard"`, `"lens"`, `"workflow"`, `"schema"`, and `"xmd"`. The `"name"` string allows specific JSON assets to be referenced. The `"name"` can take `"*"` as well, to apply to all of one asset type or a group of one asset type. For workflow type, name must be `"*"`. |
| `label`     | String |                                            |          |                                                                                                                                                                                                                                                                                                                                                     |
| `actions`   | Array  |                                            | Yes      | 4 action types: `add`, `put`, `set`, and `delete`. Can have as many actions as needed in the array.                                                                                                                                                                                                                                                 |

Example `appliesTo` value:

```nolang
{
    "type": "dashboard",
    "name": "dashboardOne"
}
```

Example `actions` value:

```nolang
{
    "action": "set",
    "description" : "A desc",
    "path": "$.json.path",
    "value": "setValue"
}
```
