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
Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024