When you use the "dot" notation its strictly literal, and your objects don't have a property named "key_value." If you use the square bracket notation you can use a variable, which is what you want to do.