Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hey there - I am trying to use flow to set the value for a metafield with the type Link. My understanding is that there are two portions of the Link metafield... the text that is displayed and the URL.
I created a flow that sets custom.metafieldname.value.text and custom.metafieldname.value.URL ... and the flow says it runs ... but the metafield doesn't seem to actually update.
I am likely doing something horribly wrong ... so any help is appreciated.
Thanks!
Solved! Go to the solution
This is an accepted solution.
That is not how you set them. A namespace and key will not include any ".". In the above, your namespace is custom and the key is metafield name. The value field for a link type metafield can be found in the docs. https://shopify.dev/docs/apps/build/custom-data/metafields/list-of-data-types
For a link it looks like:
{
"text": "Learn more",
"url": "https://shopify.com"
}
This is an accepted solution.
That is not how you set them. A namespace and key will not include any ".". In the above, your namespace is custom and the key is metafield name. The value field for a link type metafield can be found in the docs. https://shopify.dev/docs/apps/build/custom-data/metafields/list-of-data-types
For a link it looks like:
{
"text": "Learn more",
"url": "https://shopify.com"
}
Thanks! That helped me figure it out.
Hey Paul,
Follow up about a metafield that's a list of links. I've checked the documentation and made sure my formatting matches, except for the line breaks. My Flow automation to update the metafield list of links keeps triggering an error, however. Does Flow not support the List of Links? I have "List of URLs" selected, and don't see the option "List of Links."
Here are all the "List of" options:
I am getting this error (bolded the parts that are not the value/contents):
Exception: Got error updating metafield: "Type 'list.url' must be consistent with the definition's type: 'list.link'." For value: "[{ "text": "", "url": "https://admin.shopify.com/store/xxx/checkouts/35313837703396"},{ "text": "", "url": "https://admin.shopify.com/store/xxx/checkouts/35313724457188"},{ "text": "", "url": "https://admin.shopify.com/store/xxx/checkouts/35313837703396"}]", Type: list.url
Looks like your text fields are all blank. But a list of URLs is not the same as a list of links. So you need to select "list of links" and make sure you provide them with a title. But I don't think Flow currently has that metafield type available.
If possible you could change your metafield type to be a list of URLs. And then provide those URLs according to this doc: https://shopify.dev/docs/apps/build/custom-data/metafields/list-of-data-types
Hey Paul, the first 2 links in the list, I added manually and they didn't require the text field. So it doesn't seem like the text field is required, so I don't think that is the problem.
I'm concluding the option "list of links" is just not currently supported, as you suggest.
List of links is a new metafield type. Flow will support it relatively soon.