Can anyone help me understand what might be causing this error and how I can resolve it? Any advice on the correct setup or common pitfalls to avoid would be greatly appreciated.
Thank you in advance for your help!
Additional Information:
•I’m using Shopify Plus.
•The goal is to track the number of fulfilled orders for each customer using a custom metafield.
Hi @divyaneelam Thanks you so much for the great detail of your issue, very refreshing to see.
The key is “orders” NOT “*custom.*orders” “custom” is the namespace , based on the description and 2nd image showing the value of the flow actions key field and error message.
You may also need to use the .value property for some metafield types {{ order.customer.metafields.namespace.key.value }}
I also recommend doing the hard work of naming things for better contexts now or in the future.
You want to be able to use metafields verbally or describing business logic without ambiguities.
Renaming it to something like reporting.fulfilled_orders_count , or stats.fulfilled_orders_count , fulfillment.fulfiled_orders_count etc.
Something that makes sense for the purpose of what’s being made as a statement.
As you grow custom.orders kinda implies that some custom order action has occurred, such as an order was edited by staff or product personalization , for all the orders in that metafields orders value, but the values aren’t actually “orders” objects or id references it’s just a number count.
The custom thing is just a placeholder when metafields are being made and a clue better naming is warranted.
Metafields cannot be accessed the same way in Flow as they are in theme liquid (using something like order.namespace.key).
To access a single metafield value, you click “Add a variable” and then click find the “metafield” variable (note: not the plural metafields). It will guide you to choose your metafield and add it to the environment.
Once you do that, Flow stores that metafield type for the workflow and it will be accessible to other steps as a variable in the picker.