For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
I followed the tutorial for creating a custom flow action here. I have a custom flow action called THS Flow Apply Discounts that I want to attach to "Draft order created" and it needs the ID of the draft order. I'm getting an error "Required data not found" though when I try to set up the flow (see screenshot).
Here's my shopify.extension.toml file where I put the "order_reference" as a required setting field.
[[extensions]] name = "THS Flow Apply Discounts" type = "flow_action" handle = "ths-flow-action-apply-discount" description = "Applies THS discounts to a draft order" runtime_url = "https://voice-span-tomatoes-stable.trycloudflare.com/flow-action/apply-discounts/execute" [settings] [[settings.fields]] type = "order_reference" required = true
Am I doing this correctly? Is there something else I Need to do to set up the flow so my custom action can get the order reference from a draft order?
Hi Winterpkvtg,
It looks like your configuration is correct as you set the order_reference
as a required field. However, the error you're experiencing may be due to the fact that the draft order ID is not being passed properly to your custom action.
The "Draft order created" trigger should pass the ID of the draft order that triggered the workflow. Make sure that your custom action is correctly configured to receive this ID from the trigger. If the custom action is not receiving the ID, it could result in the "Required data not found" error.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Make sure that your custom action is correctly configured to receive this ID from the trigger. If the custom action is not receiving the ID, it could result in the "Required data not found" error.
Can you please explain this? I thought that was what I was doing with the order_reference setting field.
To follow up on this I tested by removing "required" in my settings.fields
It now sends an order_id in the properties with a null value. I think this might be a bug on the Shopify side.