Dynamically select multiple metafields for display in a section or block

Hi Shopify experts,

Is it possible in the liquid template language to select dynamically a bunch of metafields (for the current product) based on a common trait e.g. their keys all start the same way (“tabs-”) and then loop through the metafields in order to display them?

From the manual it appears I can only fetch metafields using a complete key (and then it gives me one metafield). I was looking at this manual page: https://shopify.dev/api/liquid/objects/metafield

Dynamical selection of multiple metafields would be useful to us: it would allow to divide the page into e.g. a tabbed area and a bulleted list, and then let the users decide later where to put the data by giving the metafield a suitable name (if the name starts with “tabs-” the metafield is displayed in the tabbed area, etc.).

With best regards,

Maedeli Hennekam

You can’t loop through metfields without knowing the key and namespace