# 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](/integrations/build-an-integration/customizing-the-overlay-window/templates/conditionals.md).

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](/integrations/build-an-integration/customizing-the-overlay-window/component-file/computed-properties.md).

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.polarity.io/integrations/build-an-integration/customizing-the-overlay-window/templates/built-in-helpers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
