When you're using liquid (clips), we check for common errors that would result in broken liquid. Though your work will be saved, these errors will prevent you from moving on to targeting. You'll still be able to send tests or Save and Preview the email. When you save, preview, or test the email you'll get an error message at the top left corner of your screen. There will be a more detailed explanation of the errors below the email body. These errors will say what the error is, and if it's in your email wrapper. Here's what each of these errors mean:
- (An error message) in email wrapper
- Undefined variable X
- Tag X not found
- Variable X was not properly terminated with regexp
- Did you mean to use a Liquid tag here?
- Wrong number of arguments
- Comparison of String with X failed
(Some sort of error) in email wrapper
If you get an error like "undefined variable X in email wrapper" or "tag X not found in email wrapper" then that means there's an error in your email wrapper. Check the email wrapper that you're using, and look through the rest of this document for the corresponding error.
Undefined variable X
It could be exactly what it says — you are using a variable that doesn't exist. You need to define variables before using them. For example, if you're using {{ First_Name }} you will get this error because the variable First_Name does not exist. It should be {{ FirstName }} which is the built-in clip. If you're using a custom variable, you may get this error if you haven't captured and assigned your variable yet (see the examples here for more on capture and assign).
Check a couple things to see why you're getting this error. Toggle to HTML and do a search for that variable, and make sure it's defined.
Check your spelling on the field, make sure there's no leading or trailing spaces (unless those are in your variable name), and see if you have any unclosed quotes.
You could have smart quotes, which are the slanted quotes rather than the straight up and down ones (see picture below). This often happens if you're copy and pasting your liquid from somewhere else, like a google doc. If you're working in an email, switch to HTML mode to see these a little clearer. Simply swap out the slanted quotes with the vertical quotes and it will work.
Tag X not found
You may get this error when you're using the {{ 'your_tag_name' | contains_tag }} filter, which looks for tags in your group. This error means that the tag you are looking for doesn't exist. For example, you could have {{ 'donor' | contains_tag }} and get the error because your tag name is Donor with a capital letter.
Check a couple things. It could be exactly what it says — you are using a tag that doesn't exist. Check your spelling of the tag on your tags page, make sure there's no unnecessary leading or trailing spaces, and see if you have any unclosed quotes.
You could have smart quotes, which are the slanted quotes rather than the straight up and down ones (see picture in the section above). This often happens if you're copy and pasting your liquid from somewhere else, like a google doc. If you're working in an email, switch to HTML mode to see these a little clearer. Simply swap out the slanted quotes with the vertical quotes and it will work.
Variable X was not properly terminated with regexp
You probably are missing a curly bracket, no big deal! When you're inserting a variable with liquid, it needs to have two curly brackets at each end, not just one. For example, you'll receive this error if you have {{ Email } instead of {{ Email }} .
Did you mean to use a Liquid tag here?
You are missing a curly bracket at the beginning of your liquid. It's an easy fix, especially since this error tells you which variable is causing the problem. For example, you may have { Email }} instead of {{ Email }} .
Wrong number of arguments (given 1, expected 2)
You may get this error when using filters, which are the strings that come after pipes (|) in liquid that modify the variable, like capitalize and commonize in {{ FirstName | capitalize | commonize }}. These filters can get more complex, like {{ HighestPreviousContribution | times: 2 }}. This error message means there is something wrong with your filters.
When you get this error, you have an argument that isn't complete. You could have a quote somewhere that isn't closed, something like {{ 'your_custom_field_name' | form_value | default: 'your_default_value }}. The missing quote on the default filter would cause this error. This error means that between the two arguments (the arguments being form_value and default), one is not fully finished.
Comparison of String with X failed
This error message means that your variable in the comparison (something using a ==, >, or <) isn't able to be completed. This is often because your liquid is being interpreted as the incorrect data type (either a string, number, boolean, array, dictionary, datetime, or null). Both the variable and the thing you're comparing it to need to be the same data type.
You probably have something in there that compares a variable to value, something like {% if 2021_total > 1 %}. The variable that you're comparing isn't the correct data type. It's being interpreted as a string, rather than an integer. To fix this, use an assign with the times filter after your capture, like this: {% capture 2021_total %}{{ '2021_total' | form_value | default: '0' }}{% endcapture %}{% assign 2021_total = 2021_total | times: 1 %}