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>
Try this:{{if(1.Note != ""; 1.Note + "<br>"; "") }}
Jim - The Monday Man (YouTube Channel)
Watch Our Latest Video: Creating monday subitems using callin.io - The EASY Way
Schedule a 1-on-1 Tutorial Session
Hi Jim, thanks for the reply. I attempted your suggestion, but it's still not truncating the note when the field is empty. Here's a copy-paste from the module:
{{1.Client}}
{{if(1.Note + "!=''"; 1.Note + " n"; "''")}}
It appears you typed the text rather than using copy-paste.
The “!=” operator, which signifies "not equal to," should appear in green. You can select it from the General functions menu. Alternatively, to type it, you need to enter “{{!=}}” without the quotes.
Upon closer inspection, there seems to be an issue with the quotes as well.
Copying and pasting from my initial response would likely be the simplest solution.
Hi Jim
Apologies, it seems I only saw the Math functions previously. I've made the adjustment now, but it's still not functioning correctly. Please note that I've updated the field to one called 'season'. However, when an email is sent, the row without a season still appears blank.
Can you provide an example output when the Season is null versus when it is not null?
Hi Jim
The email update is for updates of garment creation.
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, meaning no text is present.
When it’s not empty, it’ll contain text such as ‘Spring/Summer’ or ‘Pre Fall’.
So, the output in my test currently looks 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.
At this point, I would verify that Season is indeed empty. Please try this:
{{if(length(1.Season) > 0; "123" + 1.Season + "<br>"; "ABC")}}
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 appears the second instance is empty - or at least lacks any text…
I'm uncertain about the specific change. However, if you now simply remove "123" and "ABC", it should function correctly.
It does indeed work.
Thank you very much for guiding me through the debugging process.
Glad I could assist!
Jim - The Monday Man (YouTube Channel)
We Create Custom Solutions
Schedule a 1-on-1 Tutorial Session