# Issue with handlebar statement in Shopify - NetSuite item lookup

**URL:** <https://connective.celigo.com/t/issue-with-handlebar-statement-in-shopify-netsuite-item-lookup/4133>\
**Category:** Integrator.io\
**Tags:** lookup, handlebars, shopify, netsuite\
**Created:** [April 3, 2025, 3:24pm UTC](https://connective.celigo.com/t/issue-with-handlebar-statement-in-shopify-netsuite-item-lookup/4133 "2025-04-03T15:24:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coryanderson](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coryanderson](https://connective.celigo.com/u/coryanderson)\
**Post date:** [April 3, 2025, 3:24pm UTC](https://connective.celigo.com/t/issue-with-handlebar-statement-in-shopify-netsuite-item-lookup/4133/1 "2025-04-03T15:24:40Z")

</div>

I have a requirement when creating orders from Shopify to NetSuite. The logic is this:

If line\_items[_].sku = “BASE”, then output ‘Order Protection’  
If line\_items[_].sku contains “TIER”, then output ‘Order Protection’  
Else output line\_items[\*].sku

I've tried many handlebar statements. At this point I have this:

 ![A software interface displaying a conditional filter configuration using a template with comparison logic for line items. (Captioned by AI)](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/e/e3252eab9a4347189cf56834065f61f8d10a1ef7.png)

If I put a handlebar of just {{{line\_items.\*.sku}}} then the lookup works and the order is imported.

I believe this handlebar should work, but does not.

{{#compare line\_items._.sku "==" "BASE"}} Order Protection {{else}} {{#contains line\_items._.sku "TIER"}} Order Protection {{else}} {{{line\_items.\*.sku}}} {{/contains}}{{/compare}}

This simplified version does not work either:

{{#compare line\_items._.sku '===' 'BASE'}}Order Protection{{else}}{{{line\_items._.sku}}}{{/compare}}

Any thoughts on how to get this to work?

---

<div class="post-metadata">

**Author:** ![coryanderson](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coryanderson](https://connective.celigo.com/u/coryanderson)\
**Post date:** [April 3, 2025, 4:20pm UTC](https://connective.celigo.com/t/issue-with-handlebar-statement-in-shopify-netsuite-item-lookup/4133/2 "2025-04-03T16:20:20Z")

</div>

````auto
{{#compare line_items.*.sku '===' 'BASE'}}Order Protection{{else}}{{{line_items.*.sku}}}{{/compare}}```

{{#compare line_items.*.sku "==" "BASE"}} Order Protection {{else}} {{#contains line_items.*.sku "TIER"}} Order Protection {{else}} {{{line_items.*.sku}}} {{/contains}}{{/compare}}
````

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [April 3, 2025, 6:16pm UTC](https://connective.celigo.com/t/issue-with-handlebar-statement-in-shopify-netsuite-item-lookup/4133/3 "2025-04-03T18:16:41Z")

</div>

Looks like this is a bug. I have this working at runtime, but not in preview.

```handlebars
{{#compare items[*].name '===' 'Citrix Systems iBusiness'}}Watch{{else}}{{{items[*].name}}}{{/compare}}

```

---

<div class="post-metadata">

**Author:** ![coryanderson](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@coryanderson](https://connective.celigo.com/u/coryanderson)\
**Post date:** [April 3, 2025, 6:18pm UTC](https://connective.celigo.com/t/issue-with-handlebar-statement-in-shopify-netsuite-item-lookup/4133/4 "2025-04-03T18:18:38Z")

</div>

OK, I'll give that a shot.
