Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
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
Solved! Go to the solution
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.
The naming follows the GraphQL API, so it's
{{ order.customAttributes['key'] }}
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.
{{ 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
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.
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.
Work like charm.
Thank you so much
I would go with something similar to this:
{{ order.customAttributes | where: "key", "Delivery-Date" | map: "value" | join: "" }}
Why? To avoid unnecessary for loop. This is also a much more simpler to write as oneliner.
Idea is first find correct attribute by key using liquid where filter (https://shopify.dev/api/liquid/filters/array-filters#where) and pick the value. Don't find any other liquid method/filter to return value than map it to new array and then join the found value(s) as string
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024