Access metaobject within Flow?

Use case: I’d like to assign a variant in a metaobject that could then be called out in Flows to more easily do an HTTP request for 3rd party fulfillment update.

Currently, we use a Flow to add a line item to the order after the fact based on a qualifying event (loyalty program tag added to customer after qualifying order). We then do some basic tagging, but end with a Send HTTP request to update fulfillment and offset (basically we have a free/fake product that’s $0 for the order and then we offset those in the order - add in the real product, and reduce the fake product).

Is there a better way to do this for the moment (adding a line item but making it $0) OR more to just modifying the existing Flow, just setting it so that I can access a globally accessible metaobject to catch the variant and then check a variant metafield I’ve assigned to that variant (of course because the fulfillment software has their own variant ID).

Hi Taylor,

Thanks for highlighting this feature request and for detailing your use case - this is super helpful for our product teams to understand how to support this and the value of investing time to build this. I’ve flagged this to the Flow product team, and will update here when I hear more.

1 Like

Hi Taylor,

It’s a bit unclear how you have this implemented now, but you can do order editing using Send Admin API request now, which allows you to add a variant and discount it 100% (unlike the Add order line item action).

I’m not sure if that makes your metafield need moot or not?

1 Like

Hey Paul thanks for asking!

Basically I was hoping to extend an existing metafield - rather than go through the whole rigmarole of re-doing a bunch of Flows. Plus, we are adding a product AFTER a tag change from third party (Yotpo loyalty program).

My hope was to be able to set something so the merchant doesn’t have to keep asking me every time they change the free gift product to update the values we need stored in variant metafields for the third-party fulfillment (Katana, that keeps it’s own set of variant Ids).

My thought was (order created trigger is the one we’re using) being able to create a metaobject that could then reference the product to be added to the order AND also access the variant metafield associated to grab the alternate variant Id. If I could set a metaobject to this value, the merchant wouldn’t need me to come in and adjust the Flow for the HTTP calls that are currently hardset values but maybe I can try accessing via the Send HTTP request instead :thinking: they might have an easy enough time doing the variant picker to add to the order.

Might have been trying too hard to make metaobjects work here since I like using them for everything and they have global access.

You can update metaobjects via Send Admin API request.

I’m not sure how you get the variant to add…is that attached to one of the line item / products? If so that should be doable in Run code, which you could pass to Send Admin API request.

2 Likes

The need for the metaobject was just so I could set a globally accessible variant essentially so the merchant can update this themselves. They’re comfortable updating metafields for products/variants as needed, but in this instance I was wanting something where they could update themselves and I could dynamically access the variantId based on an assigned metaobject.

In my thought process, I wanted a metaobject because it’s updated in one place and they can always access this at a later time and we could also use in storefront promotions easily as well to showcase the free product.

As is, at the moment, I have to go in and update the values whenever they change and that’s fine. I am just always looking for a way to make it so that merchants don’t need to contact me for something “simple” like changing out one of our promotional products but it has the added element of needing access to those variant metafields as it has to make a call to our 3rd party fulfillment software.

All-in-all, I could maybe do most of this with metaobjects (just have all the data accessible there maybe? but not ideal since it’s not super accessible at the moment so I’ll probably update as you recommended anyways with an admin api action).

I need to reconfigure this one anyways since we’re doing a lot of retries on the qualifying order waiting for Yotpo to update the tag lol this was before the customer tag changed trigger was available so we have a lot of repetition. Just something I’ll have to hit when it’s a high enough priority for the merchant.

I think what you are would need there is a way to get that metaobject entry value when a workflow runs. There’s a lot of use cases for that type of thing in Flow, as it allows you to use metaobjects as global variables for workflows.

We don’t have a feature yet for this, but we have explored it (as well as a “Get metaobject entries” query). The latter of these just got a lot more valuable with the ability to query by value.

I don’t have a timeline yet for this but I think we’ll be looking at it again in early 2025.

1 Like

Thanks Paul! Appreciate the feedback or at least confirmation here for what I’m looking for / hoping for isn’t quite yet available in the way I was thinking.

Definitely some things I need to do to improve the existing Flow so maybe will do that before worrying about the metaobject route.

Appreciate it!