Invalid Operator for #compare

What's wrong with my use of compare here? I think I'm following https://connective.celigo.com/t/else-compare-case-block-handlebar/4589

 {{#if Lines_Product_ProductType_Description}}
                    <Description>
                        {{#compare lowercase Lines_Product_ProductType_Description "===" "outerwear jackets"}}"Tops"
                        {{else}}"Other"
                        {{/compare}}
                    </Description>
                    {{/if}}

My input data looks like:
"Lines_Product_ProductType_Description": "Insulator Jackets",

And I get the error:
Message: helper {{compare}}: invalid operator: Insulator Jackets

Thanks!

Hi @Daniel_Wilson ...

I think the following will work for you:

{{#if Lines_Product_ProductType_Description}}
        <Description>
          {{#compare (lowercase Lines_Product_ProductType_Description) "==" "outerwear jackets"}}Tops{{else}}Other{{/compare}}</Description>{{/if}}

1 Like