Update Metafield by counting number of purchased products

You can’t access metafields that way in Flow yet. Storefront does something special to fetch metafields values by namespace. In Flow, you loop over order.customer.metafields … FYI if you click add variable and choose the metafield value it will show you the loop part.

Another way to do it is using where:

{% assign my_mf = order.customer.metafields | where: “namespace”, “custom” | where: “key”, “pledgedcards” | first %}
{{ my_mf.value }}