I want to be able to have different columns for each metafield, but can’t work out the liquid to do this.
I was trying something like this (where the bold text is my namespace.key:
{% for metafields_item in product.metafields %}
{% for metafields_item in product.department %}
{{metafields_item.value}}
{% endfor %}
{% endfor %}
It seems odd that there isn’t a way to say that I only want to show the value of one particular metafield per column. I assume that must be possible and that I’m just missing something.
Having looked over it further I think the issue may be in how I presented the prolem.
Let’s say we have 2 metafield each with multiple options that can be added.
Metafield 1
Metafield 2
Option 1
Option A
Option 2
Option B
Option 3
Option C
For the purposes of explaining this the bold ones are the ones I add to the product.
When this gets to the google sheet it gets recorded as below (where whitespace is added if options were used that weren’t the first option available.
[“Option 1”]
[“Option 2”]
[“Option A”]
[“Option B”]
I need it to record values from the same namespace.key together i.e.
Option 1, Option 2
Option A, Option B
I suspect I need to use some combination of trim, remove (for the [“”]) and join (to make it a comma separated list, but can’t work it out.
If the google sheet connecter will always split MF values across multiple columns it is not usable by us. Suspect this may be a common issue for multi-select MFs.
There isn’t actually a comma to keep. The metafield value split over different columns in sheet. What I want to do is keep all MF relating to any one particular namespace.key within the same cell and have them in a comma separated list, with all that whitespace removed.
Otherwise it become impossible to read the sheet as the MFs will not line up vertically with each other.
It split over multiple columns because it has a comma in it and the Sheets
action will split by comma. If you want them in the same column, you need
to keep or replace (maybe with a space, " ") the original comma