Shopify - Netsuite, Change Shipping Method based on meta data

I tagged this with a handlebar expression tag because I think it might be the solution but I am new to customizations in Celigo.

I have a boolean meta field in Shopify for Orders that is set to ‘true’ when an address field parses to a “PO Box”. I’d like to use this data to then override the Shipping Method default mapping when exporting to Netsuite. The Shipping Method itself is not used in Shopify. The Shipping Method should still use the mappings setup in the integration when meta field is ‘false’ or NULL.

Any guidance on how to set this up would be appreciated.

The best way to do this is the lookup.

  • See below

I could be wrong but because Celigo does not have eq function in handlebar it will be difficult to do this via a handlebar.

Link to available handlebars:https://docs.celigo.com/hc/en-us/articles/360039326071-Handlebars-helper-reference#handlebars-helper-reference-0

1 Like

The compare block handlebar lets you do equals or other operators:
https://docs.celigo.com/hc/en-us/articles/39750593050907--compare-helper#UUID-8bfeeb4e-2888-bd28-6af4-4e3c13de311a

1 Like

One to the notebook! Can confirm the below is working fine.

{{#compare ShippingAddress.PostalCode "===" true}}000001{{else}}{{#compare ShippingAddress.PostalCode "===" "true"}}000001{{else}}000002{{/compare}}{{/compare}}

000001 and 000002 are internal IDs of shipping methods.

3 Likes

You can simplify it as well by using else compare:

{{#compare ShippingAddress.PostalCode "===" true}}000001{{else compare ShippingAddress.PostalCode "===" "true"}}000001{{else}}000002{{/compare}}
2 Likes

Thanks so much for providing a solution but now I am failing to implement. What I have is a meta field on the Shopify Order set by a Flow. But it seems the meta fields don’t appear on the .json of the order so I am unable to do the compare. I am not seeing a way to update meta field “custom.po_box” to the Shipping_Lines or Shipping_Address groups on the json. Is the only way to do this through order.tags then? I was hoping to make it somewhere unobtrusive and immutable.