website logo
Navigate through spaces
ChartHop documentation
⌘K
ChartHop Help Center
Getting around in ChartHop
ChartHop for Employees
Implementing ChartHop
ChartHop for Administrators
Carrot reference
ChartHop for Developers
Partners
Release notes
Resources
Docs powered by archbee 
website logo

Using Carrot to reference org data

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.

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.

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.

{% 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 %}




Updated 18 May 2023
Did this page help you?
Yes
No
PREVIOUS
Creating templates
NEXT
Example Templates
Docs powered by archbee 
TABLE OF CONTENTS
Useful Carrot expressions
Specify date formats
Substitutions
If condition
If... elseif / else
For loops (iterations)