# JSON Variable Length

**URL:** <https://community.brightpattern.com/t/json-variable-length/543>\
**Category:** Product Q&A\
**Created:** [November 19, 2021, 3:29pm UTC](https://community.brightpattern.com/t/json-variable-length/543 "2021-11-19T15:29:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avengers\_Phone\_Wars](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@Avengers\_Phone\_Wars](https://community.brightpattern.com/u/Avengers_Phone_Wars)\
**Post date:** [November 19, 2021, 3:29pm UTC](https://community.brightpattern.com/t/json-variable-length/543/1 "2021-11-19T15:29:32Z")

</div>

I have a ‘Collect Digits’ block that asks the caller to input the casenumber.

I want to have an IF block, that checks if the variable is a specific amount of digits, but not sure how to do that via JSON.

---

<div class="post-metadata">

**Author:** ![Dr\_Jan\_Itor](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@Dr\_Jan\_Itor](https://community.brightpattern.com/u/Dr_Jan_Itor)\
**Post date:** [November 19, 2021, 3:35pm UTC](https://community.brightpattern.com/t/json-variable-length/543/2 "2021-11-19T15:35:52Z")

</div>

There is JSON function that will do length for you. Something like =length(’$(casenumber)’) should do the trick.
