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.