# Built-in Helpers

## Truth Helpers

A set of helpers is made available known as ember-truth-helpers. These helpers allow you to include additional logic within your handlebar templates such as `and`, `or`, `gt`, `lt` etc.  Truth helpers are used in conjunction with [conditionals](https://docs.polarity.io/integrations/build-an-integration/customizing-the-overlay-window/templates/conditionals).

Assume we are working with the following return data from our integration which includes the `numResults`, `severity` and `confidence` values.

```javascript
// Result Object Returned from integration
{
  "entity": entityObj,
  "data": {
    "summary": ['Tag 1'],
    "details": {
      "numResults": 10,
      "severity": 75,
      "confidence": 50,
      "source": "Threat Intel Report"
    }
  }
}
```

We can make use of the `gt` (greater than) helper to only display data if there are results.

{% code title="template.hbs" %}

```markup
{{#if (gt block.data.details.numResults 0)}}
    There are results
{{/if}}
```

{% endcode %}

You can combine multiple truth helpers to construct more complex conditional statements.  For example, if we only want to display data if the `severity` is greater than 70 **and** the `confidence` is greater than or equal to 50 we can do the following.

{% code title="template.hbs" %}

```
{{#if (and (gt block.data.details.severity 70)(gte block.data.details.confidence 50))}}
    {{block.data.details.source}}
{{/if}}
```

{% endcode %}

If you find yourself writing extremely complex logic using the truth helpers you will ofentimes want to convert the logic into a single [computed property](https://docs.polarity.io/integrations/build-an-integration/customizing-the-overlay-window/component-file/computed-properties).

{% hint style="info" %}
For more information on how to use these helpers please see the official documentation for [Ember Truth Helpers](https://github.com/jmurphyau/ember-truth-helpers).
{% endhint %}

## Date Helpers

The excellent `ember-moment` helpers are available in integrations to assist with formatting dates. You can find more information about how to use ember-moment from the ember-moment website:

<https://github.com/stefanpenner/ember-moment>
