Hi everyone,
I’m working on a Specification Table for my website that automatically pulls metafield data from products and displays it as a table. I’ve written two parts of the code: one for retrieving the data and another for the design. However, I’ve encountered two issues and would greatly appreciate any help!
Issue 1: Incorrect Field Being Displayed
Currently, the Specification Table is using the metafield Namespace and Key data instead of the Name field I want. For example, in my metafield settings:
Settings → Custom data → Products → “iPhone Compatible”
The table shows the text as Iphone_compatible (with underscores and capital letters) instead of iPhone Compatible.
The relevant part of my code is:
{{ spec.first | capitalize }}Since I don’t know the exact field name to call, I’ve been using the Specification-name, which defaults to the key. How can I update this code to pull the Name field (the human-readable label) instead of the key?
Issue 2: Manual Sorting of Specification Data:
Right now, the specification table are displayed in alphabetical order, like this:
Battery
Charging_distance
Depth
Height
Iphone_compatible
Kit_contents
Output
Qi_compatible
Usb_c_input
Usb_c_output
Weight
Width
As you can see, related items like Depth, Height, and Width are not grouped together. I’d prefer to manually control the order of these specifications for each product.
Is there a way to modify the code to allow manual sorting of the metafield data? Ideally, I’d like a way to define a custom order per product.
Thanks in advance for any help or guidance you can provide on these two issues!

