Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hi everyone!
We are using Flow to send order creation triggered internal emails with certain data from the order and its included line items. For some orders those variables can be empty. So my question is how to hide the entire variable output within the mail when no data is available.
Example:
Order summary: {{order.name}} <br>
{% for lineItems_item in order.lineItems %}
Quantity: {{lineItems_item.quantity}} <br>
Product: {{lineItems_item.title}} <br>
Variant: {{lineItems_item.variantTitle}} <br>
{% endfor %}
Not all products have variants so I'd like to hide the entire line "Variant: ..." if no data exists.
Help would be highly appreciated!
Kindest regards
Armin
Solved! Go to the solution
This is an accepted solution.
Hi RennWelten,
You can try wrapping that line in a `nil` check on the `variant` field, like:
{% if lineItems_item.variant != nil %}
Variant: {{lineItems_item.variantTitle}} <br>
{% endif %}
Hope that helps!
This is an accepted solution.
Hi RennWelten,
You can try wrapping that line in a `nil` check on the `variant` field, like:
{% if lineItems_item.variant != nil %}
Variant: {{lineItems_item.variantTitle}} <br>
{% endif %}
Hope that helps!
Find Global Growth Opportunities For Your Business with Shopify AcademyLearn how to exp...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025