# HOW TO: Use handlebars to return the length of a string

**URL:** <https://connective.celigo.com/t/how-to-use-handlebars-to-return-the-length-of-a-string/1490>\
**Category:** Integrator.io\
**Tags:** http, handlebars, javascript, netsuite\
**Created:** [July 8, 2020, 8:46pm UTC](https://connective.celigo.com/t/how-to-use-handlebars-to-return-the-length-of-a-string/1490 "2020-07-08T20:46:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![courtneyjordan](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@courtneyjordan](https://connective.celigo.com/u/courtneyjordan)\
**Post date:** [July 8, 2020, 8:46pm UTC](https://connective.celigo.com/t/how-to-use-handlebars-to-return-the-length-of-a-string/1490/1 "2020-07-08T20:46:35Z")

</div>

You can use the {{compare}} handlebar function to check the length of a string using in your HTTP body. Here is an example:

```
{{#compare phone.length "===" 10}}{{phone}}{{else}}Field length does not meet requirements{{/compare}}
```

If you are using NetSuite SuiteScript, any data coming out of that is converted into strings. Currently, you cannot check the length of numeric fields.
