A Smarter Way to Build Bulletproof Gmail Flows
Do you use the Gmail trigger in your automation flows? Then you definitely need to keep this in mind.
Did you know that email systems send emails differently? Some use the text body, while others use the HTML body.
This is critical because if your flow relies on data from only one of those fields—for instance, to extract data with Gemini or to run a condition—it might fail unexpectedly. If an email arrives with a blank text body because all the content is in the HTML body, your flow will skip a run it shouldn't have. This can be incredibly confusing to troubleshoot.
The Simple Fix
A quick recommendation is to make sure you include conditions for both the text and HTML bodies in your flow. This way, you account for either situation.
However, if you reference the email body in multiple steps, you'll have to repeat this logic over and over, which can make your flow messy and difficult to update.
A Better, Cleaner Solution ✅
To make your flows more efficient and easier to maintain, create a single variable at the beginning. Here's how:
Initialize a Variable: Right after your Gmail trigger, add a step to create a new string variable (let's call it Email Body).
Add a Condition: Check if the Text Body from the email is empty (null).
If YES (the text body is empty), set your Email Body variable to the value of the HTML Body.
If NO (the text body has content), set your Email Body variable to the value of the Text Body.
Now, you can simply use the emailBody variable in every subsequent step of your flow. You'll know it always contains the content you need. If you ever need to make a change, you only have to update it in one place, making your large flows much easier to manage!