'Sendgrid handlebar template array length

I'm trying to fetch length of an array but it seems length only exists for conditionals.

Data:

{
    "array": ["a", "b", "c"]
}

in sendgrid template:

{{array.length}}

and nothing is rendered in the email (preview renders it correctly).

Is there a workaround for this?



Solution 1:[1]

it looks like you can use the [greaterThan][1] tag

Example from Sendgrid docs:

<p>
Hello Ben!
{{#greaterThan (length cartItems) 0}}
 It looks like you still have some items in your shopping cart. Sign back in to continue checking out at any time.
{{else}}
 Thanks for browsing our site. We hope you'll come back soon.
{{/greaterThan}}
</p>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MorenoMdz