Just to confirm - you don’t want to output the value of the metafield, but instead you want to output the name (that you’ve set up internally) of the metafield? Is that correct?
Exactly, you got that right, there has been multiple times where it would have been very useful to have access to that field from liquid, because it can be used to label the value in multiple parts and it’s intuitive for my clients (merchants) to have that label be also displayed in their stores.
In this example I’m doing some custom fields for a product that get sent as order notes, but sadly I had to hardcode the labels.
Oh and edit:
-I don’t know if it makes a difference but I’m dealing with a MetaObject here that have multiple fields (I’m not sure if MetaObject fields are the same data-type as metafields) but yeah, I’m trying to access the Name property of a Metaobject Field.
It looks like there’s no way to output the name of the metafield (which is typically only used internally for metafield management/ reference) so it does look like the name will have to be hardcoded in the code of the theme (or on a custom Liquid section/ block).
I am having ditto same situation. i.e. metafiled and metaobjects linked. When I use a for loop for going through varaints using “variant.metafields.custom.color” (where variant = product variant, custom = namespace and color is the metafield name), I am getting “gid://shopify/Metaobject/102512787730” of metaobject and not any other reference. If some one can suggest, how to read actual value from this then we are done.