Can't get an If-statement to work when pulling information from an Airtable database into a Text aggregator

I have a bunch of information in an Airtable database wherefrom I send Weekly updates out.

I use a Text aggregator to create all the the info about each record that is sent out.

It looks something like this:

{{1.Client}}
<br>
{{1.Note}}
<br>
{{1.EmailNotificationName[]}}
<br>
<b>{{1.EmailNotificationTrigger1}}</b>
<br>
<b>{{1.EmailNotificationTrigger2}}</b>
<br>
do_not_remove_me
<br><br>

However sometimes the Note field is empty and create a weird empty row so I want the text aggregator to disregard this filed if it’s empty.

I’ve tried the below, but it’s creates an error, so not entirely sure what to do. Hope someone in here can guide me in the right direction.

{{1.Client}}
<br>
{{if(1.Note; 1.Note + "<br>"; "")}}

{{1.EmailNotificationName[]}}
<br>
<b>{{1.EmailNotificationTrigger1}}</b>
<br>
<b>{{1.EmailNotificationTrigger2}}</b>
<br>
do_not_remove_me
<br><br>

@Trager

Try this:
{{if(1.Note != ""; 1.Note + "<br>"; "")}}


Jim - The Monday Man (YouTube Channel)
Watch Our Latest Video: Creating monday subitems using Make - The EASY Way
Schedule a 1-on-1 Tutorial Session

1 Like

Hi Jim, thank you for getting back, I tried your suggestion, but still not cutting the note when the field is empty, below is a copy paste from the module.

{{1.Client}}


{{if(1.Note + “!=’’’”; 1.Note + “
”; “’’’”)}}

@Trager

It looks like you keyed in the text instead of copy/paste.

The “!=” should show up in green. It is the “not equal to” operator. It can be selected from the General functions menu. Or to key it in you will have to key “{{!=}}” without the quotes.

After a second look, there is also something going on with the quotes.

Probably the easiest way would be to copy/paste from my first reply.

1 Like

Hi Jim

Sorry, for some reason only saw the Math functions. I’ve changed it now, however it’s still not working. Note I changed the field to filed called season instead. But when I send out an email, the row with no season is still just empty.

@Trager

Can you give example output when Season is null v. not null?

1 Like

Hi Jim
The email update is for updates of garment making.
Sometimes a style will have a season assigned to it and sometimes it does not.

When null - it’s an empty field within the Airtable database, so no text at all.
When it’s not empty it’ll have text such as ‘Spring/Summer’ or ‘Pre Fall’

So the output in my test looks currently like this:

KNIT AND WOOL
Spring/Summer22
GSAK003 - LAMAINE MARL SLOUCH SWEATER
Delivery date has been moved ~ 1 day backwards.
FROM: 24/06/2022 TO: 25/06/2022
Jenny Parker

KNIT AND WOOL

KPS2319 - LOVE RETURN TURTLE NECK
Delivery date has been moved ~ 1 day backwards.
FROM: 24/06/2022 TO: 25/06/2022
Jenny Parker

Where the second instance has an empty season in the second row

@Trager

At this point, I would check to make sure that Season is actually blank. Try this:
{{if(length(1.Season) > 0; "123" + 1.Season + "<br>"; "ABC")}}

1 Like

It returns this:

KNIT AND WOOL
123 Spring/Summer22
GSAK003 - LAMAINE MARL SLOUCH SWEATER
Delivery date has been moved ~ 1 weeks forward.
FROM: 25/06/2022 TO: 16/06/2022
Jenny Parker

KNIT AND WOOL
ABC KPS2319 - LOVE RETURN TURTLE NECK
Delivery date has been moved ~ 1 weeks forward.
FROM: 25/06/2022 TO: 16/06/2022
Jenny Parker

So it does seem that the second instance is empty - or at least there is no words…

@Trager

I’m not sure what changed. But if you now just remove the “123” and “ABC” and it should work.

2 Likes

It does indeed work.

Thank you very much for walking me through and debug.

1 Like

@Trager

Glad I could help!


Jim - The Monday Man (YouTube Channel)
We Create Custom Solutions
Schedule a 1-on-1 Tutorial Session