Issue with handlebar statement in Shopify - NetSuite item lookup

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:

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?

{{#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}}

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

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

OK, I'll give that a shot.