How to create dynamic data object references

I’m a bit stuck on the following.

The following captures have the correct values. The problem arrises from the fact that the value of var_pageData is seen as a String instead of an Array I can loop over.

{%- capture var_pageID -%}{{ page.headline | downcase | replace: ' ', '-'{%- endcapture -%}
{%- capture var_pageData -%}site.data.{{ var_pageID }}.merchandise.products.available{%- endcapture -%}

{% for choice in var_pageData -%}
	my item = {{ choice.item }} <br>
{% endfor %} 

Thanks for your help.

Capture will give result as string so don’t use it.

Use assign and see if using key will work

{% assign var_pageData = site.data[var_pageID].merchandise.products.available %}

You rock @MichaelCurrin! That worked like a charm. Marked as the answer. TY

Awesome. You’re welcome