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)|
Strings are composed of letters, numbers, and special characters. They must be enclosed in double quotes in JSON. For example, the email address from our customer key in is a string.
Numbers are integers (numbers with no decimal point) and floats (numbers with a decimal point). Here’s an example of a number from the customer key we looked at above:
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:
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:
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 Module 1 when we used a tag to output “Hi friend” if we didn’t have a value for our name key.