Help us improve our product documentation on docs.cognigy.com by sharing your thoughts in a quick survey. Your feedback shapes the future of our content!
Help us improve our product documentation on docs.cognigy.com by sharing your thoughts in a quick survey. Your feedback shapes the future of our content!
// Initial context: {}addToContext("user.city", "Berlin", "simple");// Context after execution: { user: { city: "Berlin" } }// If called again with same key:addToContext("user.city", "Munich", "simple");// Context after execution: { user: { city: "Munich" } } // Overwrites previous value
Array Mode
// Initial context: {}addToContext("user.purchases", "book", "array");// Context after execution: { user: { purchases: ["book"] } }// Adding more items to the same array:addToContext("user.purchases", "laptop", "array");addToContext("user.purchases", "coffee", "array");// Context after execution: { user: { purchases: ["book", "laptop", "coffee"] } }