Trouble with Compare
Here's my original payload:
"items": [
{
"returnReasonID": "changed-my-mind",
"returnReasonNote": "",
"refundType": "store-credit"
}
]
These compare expressions all fail:
{{#each items[*].refundType}}{{#compare this.refundType "==" "store-credit"}}True{{/compare}}{{/each}}
{{#compare items[*].refundType "==" "store-credit"}}True{{else}}{{/compare}}
{{#compare $.items[*].refundType "==" "store-credit"}}True{{else}}null{{/compare}}
They're all attempting the same evaluation of refundType.
They fail in different ways:
Failed to generate field value from template: {{#compare $.items[*].refundType "==" "store-credit"}}True{{else}}null{{/compare}}. Details: Parse error on line 1: {{#compare $.items[*].refundType -------------^ Expecting 'ID', got 'INVALID'.
Before someone says it's an issue with wildcards, these similar expressions (used in different flows!) all evaluate properly:
{{#compare $.order.items[*].monogram_color "!=" NULL}}{{$.order.items[*].monogram_color}}-{{$.order.items[*].monogram_size}}{{else}}null{{/compare}}
{{#each line_items[*].properties}}{{#compare this.name "==" "__is_preorder"}}{{#compare this.value "==" "true"}}True{{/compare}}{{/compare}}{{/each}}
{{#compare line_items[*].sku "!=" "Digital Gift Card"}}-1{{/compare}}
I'm ripping my hair out.
Comments
Justin Hughes this one is working for me
What error do you get for this one? Also, what system are you going to with this?
Hi Tyler Lamparter, thanks for your response. This is a custom flow going from Happy Returns into Netsuite. When I run your particular flavor I'm getting:
Justin Hughes when you are on the mapper for NetSuite, does it preview correctly? Can you screenshot aht setup?
Please sign in to leave a comment.