---
title: Using Carrot to reference org data
slug: carrot-org-data-templates
createdAt: 2022-05-29T17:19:25.000Z
---

You can use Carrot to reference information from your ChartHop organization, such as compensation data, groups, or specific employee data, and reference it directly in your templates as dynamically-generated fields. [Learn more](https://docs.charthop.com/carrot-reference).

## Useful Carrot expressions

The following section features a list of helpful Carrot expressions available to you and illustrates how you can use them in your templates.

### Specify date formats

When using any of Carrot's date fields, such as `startDatePlanned` and so on, you need to specify the date format if you want something different from the default, which is YYYY-MM-DD.

If you use `{{startDatePlanned}}` without any indication of how you want it formatted, the date is formatted as such: YYYY-MM-DD or 2022-03-14.

If you'd like to format your dates differently from the default, you'll need to use something like this: `{{formatDate(startDatePlanned, "MMMM d, yyyy")}}`. This date is formatted as such: March 14, 2022.

[Learn more.](https://docs.charthop.com/formatdate)

### Substitutions

You can use `{{curlyBraces}}` to substitute any Carrot expression in the body of your template.

```markdown
Hello there {{name.first}} {{name.last}}!

You work in the {{department}} department, based out of the {{location}} location.
```

### If condition

You can use the `if` tag to conditionally display a piece of content.&#x20;

`{% if expression %} conditional content {% endif %}`

```markdown
{% if department:engineering %}
You are part of the Engineering department.
{% endif %}
```

### If... elseif / else

You can use `elsif` or `else` to add additional conditions to an `if` condition block.

```markdown
{% if department:engineering %}
You are part of the Engineering department.
{% elsif department:marketing %}
You are part of the Marketing department.
{% else %}
You are part of a different department.
{% endif %}
```

### For loops (iterations)

You can use the `for` tag to iterate through a series of objects.

```markdown
{% for grant in grants %}
Stock grant dated: {{grant.date}}, amount is {{grant.shares}}
{% endfor %}
```

