How can I access metaobject values in product metafields?

Using @LazaEAG example worked for a metaobject. But I wanted to use the metaobject as a database to store all the colour swatches for different products and select which ones I wanted to show on which product. The code above output EVERY colour swatch in the metaobject. So I made a metafield using the metaobject I had created as the content type.

That way for each product I can select which colour swatches from the metaobject that I want to display.

Modifying the code slightly for metafield:

{% assign swatches = product.metafields.custom.available_colours_swatches.value %}

                {% for swatch in swatches %}  
                  
                      
                      
                          {{ swatch.name.value }}
                      
                  

                {% endfor %}