How can I correctly extract metafields values in JSON code?

Variables are metafields: like the one I show on the print screen, how do I add “product.metafields.my_fields.pattern” to the place Metafield1, as I show on the print screen?

What exact piece of code do I have to add to that place?