I’m wondering if someone can help me to find a solution to updating a custom metafield using Shopify flow. I have spoken to support who advised me that it can’t be done. However, I wondered if anyone had found a workaround solution.
I am hoping to use Shopify Flow to automatically update a number of different metafields on our products. For this example, I will focus on a ‘low inventory’ flow.
I have created a flow for low-inventory products. When the inventory quantity is changed - and is more than 1 and less than 10 - the flow adds the Product Tag ‘Last Few Remaining’. This is all working correctly.
However, I would like to do one more step: display a custom badge on the product image. The custom.badges metafield has been set up in Shopify > Custom Data. When I manually add a badge to a product it works correctly and displays the badge. However, it is not working when I try to automatically add the custom.badge using Shopify Flow.
I have tried using the Flow function 'Update Product Metafield. The first screenshot below shows how I have configured this action and the second screenshot shows how this custom.badges metafield is setup in Shopify.
Is it showing as having successfully run in the run log in flow? Do you see any metafield value saved in the product? Sometimes you have to click around a bit to see potentially unstructured metafield values.
I have looked at the run logs, and they show that the tag is being added correctly, but updating the metafield has failed. The error below points to an issue with how I specified the ‘type’ field in Flow.
Do you know which Type I should be using instead? There isn’t one specifically called ‘List: Single Line Text’ as the error states.
Ideally, I would like to keep the badges set up as a pre-defined list to avoid the potential to accidentally create different values. However, I could remove this and leave it as open single-line text if that would fix the issue.
I found the fix! Following my earlier reply, I thought I would try to set up another metafield using Single Line Text > One Value with the ‘Limit to Preset Choices’ box ticked (instead of Single Line Text > List of Values). This did the trick!
The flow ran successfully and the correct metafield appeared against the relevant products.