How to check if an field is empty in a condition
Hi,
We send out order confirmations and order ready at pick up location.
We don't have the pick up location address en name available in the order ready at pick up location event, so what we do is this:
In the order event, we write the pick up location to the profile and in the ready at pick up location e-mail we retrieve those fields from the profile to show them in the e-mail.
It looks like this for the company name:
{% let igCompany = "" %}
{%#if contains(profile._clientname.igOrderEventsCollection, context.journey.events.`1154443460`._clientname.igOrder.igUid, false) %}
{% let igCompany = regexGroup(profile._clientname.igOrderEventsCollection,concat(context.journey.events.`1154443460`._clientname.igOrder.igUid,"\\.igHomeDeliveryAddress.igCompany=(.*?);"),1) %}
{%/if%}
Then we can use the pick up location name in the e-mail as this: {{igCompany}}
But sometimes we have special order were we don't have a order event for, but we do get a ready at pickup location events.
We don't want to send out e-mail for those cases, since we don't have the pick up location details available.
So my question: how can we make a condition in the journey that checks if {{igCompany}} is empty? We probably do need to state the let statements too:
{% let igCompany = "" %}
{%#if contains(profile._clientname.igOrderEventsCollection, context.journey.events.`1154443460`._clientname.igOrder.igUid, false) %}
{% let igCompany = regexGroup(profile._clientname.igOrderEventsCollection,concat(context.journey.events.`1154443460`._clientname.igOrder.igUid,"\\.igHomeDeliveryAddress.igCompany=(.*?);"),1) %}
{%/if%}
Can someone help me?
Talitha
