Managed to solve my own question through some trial and error.
So, the ‘Type’ drop down list at the bottom needs to be set/changed to the Type of the field you are outputting to (destination), in this case ‘Single Line Text’.
This got the Flow to work, but because the source field was a ‘Single Line Text with a List of Values’ (Multi-select Picklist) the output into the Destination field looked like this: [“Picklist Value 1”,“Picklist Value 2”]
So, I then had to parse/filter the values.
Depending on your use case, you may want to do one of two things, strip out the unwanted characters [ " ] and leave a comma and space between each picklist value. Or you may just want to just take the first picklist value. There are probably other use cases but I just looked at these two.
Shopify has some good Dev resources and info on Liquid String Filters here.
Anyway, Liquid code used in the Value field to copy just the first picklist value and strip out unneeded characters was:
{%- for metafields_item in product.metafields -%}
{%- if metafields_item.namespace == “custom” and metafields_item.key == “gexx” -%}
{{- metafields_item.value | replace: ‘["’,‘’ | remove_last: ‘"]’ | split: ‘“,”’ | first -}}
{%- endif -%}
{%- endfor -%}
The {{ - hyphens remove any white spaces.
| replace: ‘["’,‘’ removes the leading bracket and quotation mark and replaces with nothing.
| remove_last: ‘"]’ removes the last quotation and bracket at the end of the string.
| split: ‘“,”’ then splits the two values at “,” and creates an array (basically a table of two values, or more if there is more).
and lastly, | first which returns the first value in the array.
Anyway, works for me.
Why did I want to do this?
Well, I am using Marketplace Connect to push Product to another sales channel. However, Marketplace Connect has a limitation. It won’t directly map Single Line Text fields that have a List of Values (Multi-select picklist) - the app just won’t show any multi-select fields in the Mapping drop down, it will only show Single Line Text Fields with a single value string. I needed a workaround. So, I created a custom Single Line Text field, used Flow to copy and filter/transform the value, and then mapped Marketplace Connect to this field.
Hope this may help someone else.