How do I access collection values from a GID in a template?

Hi @RetroShirtsMan ,
You can access the collection saved in a product meta field by first assigning the collection in a variable as shown in below code:

{% assign mycollection = product.metafields["details"]["mycollectionfield"].value %}
{% comment %} 
  {{ mycollection.title }} - returns collection title  
  {{ mycollection.url }} - returns collection URL 
{% endcomment %}

Please let me know if you need more help
Thanks

2 Likes