We've created two new files for this
atb-vars.liquid - this assigns vars_keys_array and vars_vals_array
atb-render-vars.liquid - this assigns the variable from vars_vals_array
You must pass the name of the section for this one.
Use it like this:
{% include 'atb-vars' data_inc: 'data_file_here', zone: 'zone_name_here', name: 'section_name_here' %}
Then to render it
{% include 'atb-render-vars' field:'field_name_here' %}
{% assign field_name = val %}
Or to render from a selected product:
{% assign inc_file = 'sa-product' | append: product.id | append: '.json' %}
{% include 'atb-vars' data_inc: inc_file, zone: 'PDP', name: 'PDP - Hero' %}
{% include 'atb-render-vars' field:'product_title_1' %}
{% assign product_title_1 = val %}
{% include 'atb-render-vars' field:'product_title_2' %}
{% assign product_title_2 = val %}