As we’ve discussed, keys and values come in pairs—the key points to the value (aka, the specific piece of data you have stored).
Here are the simple types of values you’ll find in Liquid:
String
Letters, numerals, and special characters
Number
Integers (numbers with no decimal point) and floats (numbers with a decimal point)
Boolean
True or false flag (not a string)
Stringsare composed of letters, numbers, and special characters. They must be enclosed in double quotes in JSON. For example, the email address from our customerkey is a string.
"email":"LeeLeeson@example.com"
Numbersare integers (numbers with no decimal point) and floats (numbers with a decimal point). Here’s an example of a number from the customerkey we looked at above:
"created_at":1621454609
Boolean values simply indicate whether a particular condition is true or false. For instance you might have a key called newsletter_signup, and the value would indicate whether or not a customer has signed up for your newsletter:
"newsletter_signup":true
When a key has no value
In Liquid, a key points to a value—but sometimes your data store might be missing the value that a particular key is referencing, so there’s no value to output:
Nil: there is no value stored that corresponds to the key. This might happen if, say, a customer didn’t fill out their last name when they signed up for your newsletter. If you used the key {{ customer.last_name }} in that case, the value would be nil.
EmptyDrop: thisvalue will be returned if you try to use a key that’s been deleted. This doesn’t come up often.
These aren’t really types of values, in the sense that you’d never actually use a key to output them. Instead, think of them as potential circumstances that you can use a tag to account for, like back in the How Liquid Works lesson when we used a tag to output “Hi friend” if we didn’t have a value for our name key.