Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
On shopify flow i need to put dynamic content using liquid into a post request.
The logic specifically needs to be
If {{order.customerJourneySummary.lastVisit.referralCode}} exists, then use {{order.customerJourneySummary.lastVisit.referralCode}}. Else {{order.customerJourneySummary.firstVisit.referralCode}}
From my understanding if there is only one visit, only the firstvisit field is populated. We are trying to do last touch attribution which requires only the LAST referral code to be recorded. So this logic is necessary to ensure that if there is only one visit the post request still works.
Thanks in advance,
I also want to know how to solve this problem!
Hi WrdMax,
You should be able to write a regular if statement inside the HTTP request body, like
{% if order.customerJourneySummary.lastVisit.referralCode %}{{order.customerJourneySummary.lastVisit.referralCode}}{% else %}{{order.customerJourneySummary.firstVisit.referralCode}}{% endif %}
Just watch out for whitespace and quotes and stuff depending on how your request is being formatted.
Hope that helps!
Learn how to expand your operations internationally with Shopify Academy’s learning path...
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