Shopify Flow how to get the order additional details to use into liquid?

Solved
vasanth0791
Tourist
4 0 1

in normal order obejct get the additional details use this below liquid code.

for order created attributes "Delivery-Date", "Delivety-Time".

{{ order.attributes["Delivery-Date"] }}
{{ order.attributes["Delivery-Time"] }}

 

How to fetch the Shopify flow liquid to get the attributes.

Can someone help me to resolve this?

Thanks,

Vasanth

 

0 Likes
paul_nuschke
Shopify Staff
Shopify Staff
7 1 2

The naming follows the GraphQL API, so it's 

{{ order.customAttributes['key'] }}

 

0 Likes
vasanth0791
Tourist
4 0 1

Thanks paul_nuschke.

https://help.shopify.com/en/manual/shopify-plus/flow/create-workflow/variables#order-variables

i am expecting from shopify flow order variables need to fetch the order attributes what exactly fetching in order liquid page. That attributes value i want to get from shopify flow order variables.

investigating shopify flow variable not able to find those attribute variable insider order-variables.

 

Please let me know how to fetch the order attributes in shopify flow liquid variables.

Thanks in advance.

0 Likes
RyanFletcher
Tourist
3 0 2
{{ order.customAttributes['key'] }}

I've given this a go and the flow seems to accept this however, when changing the actual key name to a given attribute, it rejects it. For example:

{{ order.customAttributes['DeliveryDate'] }}

 

This is rejected by Shopify Flow, throwing an error message claiming that the reference does not exist.

Currently, I am using Arrigato Automation as a solution which does work well however, I thought that Shopify Flow would offer this functionality. Might be a bug but if anyone has any other suggestions, happy to take a look.

Thanks,

Ryan

paul_nuschke
Shopify Staff
Shopify Staff
7 1 2

This is an accepted solution.

Hi, thanks I see that error now. I think that is a validation bug in Flow (key passes because that's literally the name of the field). In the interim, depending on which field you are looking to use this information, you could use a loop to get at the attribute like this:

{% for attr in order.customAttributes %}
{% if attr.key == "Delivery-Date" %}
{{ attr.value }}
{% endif %}
{% endfor %}

 I have confirmed that this passes validation, but not that it works. I would love to hear back if it works for you. 

RyanFletcher
Tourist
3 0 2

Hi Paul,

Thanks for your suggestion.

I can confirm that this works as exactly as expected. Just added it to a Shopify Plus Workflow, tested and set live!

Thanks a lot.

AtulGavali
New Member
2 0 1

Work like charm.

Thank you so much