Convert One value Metafield to List of values

How can I convert change a One value Metafield into a List of values metafield? Is that possible?

I already set a lot of metafields and I didn’t realize that I can’t select multiple values from a One value Metafield. I created it wrongly and I’d need a List of values one where it works. I tested it.

@GG9

hi,

friend its not possible to change one value metafield to list value. if you want to use list metafield then create a new metafield.

1 Like

Hi @GG9

This is Kate from PageFly - Landing page builder, I’d like to suggest this idea:

It is not possible to convert a One value Metafield to a List of values Metafield on Shopify. You will need to create a new List of values Metafield and manually transfer the values from the old Metafield to the new one

1 Like

Hi @GG9 Please don’t apply labels like “optimization” to posts unrelated to that topic.

There is no native UI to do conversions of metafield definition(mfdef) types.

See the following post, though I have not confirmed it can be used with non-list types to list types.

So you should first test it with some fake mfdefs before proceeding

:bomb: Before deleting a metafield definition(mfdef) backup the data, see metafield manager or data export apps or the api

https://community.shopify.com/topic/1372450

If that is not working the rough programmatic process when objects cannot have their original access names(namespace or key) changed:

If the metafields, keys &names, are in already in use in production then you need a create, copy, backup, delete, create, copy process for metafield definitions(mfdef).

  1. Create a placeholder mfdef of list type with a temp name
  2. Copy the initial data from the existing in use metafield to the placeholder
  3. Confirm the data is backedup and in this temp mfdef
  4. Delete the in-use mfdef to free up the namespaces key
  5. create the replacement mfdef of list type with the original name of the original mf-def

This way you do not need to modify any frontend usage of the metafields.

If you don’t know how to create a full app, there’s automation tools like usemechanic that can be scripted for such things.

It may now be theoretically possible to use shopify flow new data-list features do the copying operations of mfdefs, but not the creation or deletion at this time.

If you search the forums for change metafield namespace key, there are some apps-staff that outline how to user their apps for such things.

1 Like