Good catch! I removed the commas and the problem remains.
Topic summary
A developer is experiencing issues with a Shopify Flow code step that calculates refund amounts based on order cancellation timing. The function correctly processes the logic (full refund if cancelled within 10 days, 90% refund otherwise) and console.log shows the expected output with proper values.
The Problem:
- Step output returns an unexpected structure with the data nested under “message” as a stringified array
- The “return_value” object appears empty
- Expected output should directly contain “refundAmount” and “refundMessage” properties
Troubleshooting Attempted:
- Removed syntax errors (commas in GraphQL query and Output schema) as suggested
- Issue persists after corrections
Current Status:
One commenter suggests the code may actually be working correctly and requests more details about how the output is being used in subsequent Flow steps. The core issue—why the return value structure doesn’t match the defined Output schema—remains unresolved.