Skip to main content

Description

This Node stores information in the Context object. With this approach, you can use the stored value throughout the session on subsequent user inputs.

Parameters

ParameterTypeDescription
KeyCognigyScriptThe key where to store in the Context object. For example, if you enter requestedProduct, the value is assigned to the context.requestedProduct key. You can use nested keys, for example, entering user.profile.name assigns the value to the context.user.profile.name key. This parameter doesnโ€™t support dashes or hyphens.
ValueCognigyScriptThe value to store in the Context object.
ModeSelect
  • Simple โ€” assigns the value to the key.
  • Array โ€” appends the value to an array under the key. By default, you can add only unique values. If you need to add a value that already exists in the array, use the .push() function in a Code Node.
If you want to store an object in the Context object, use .preserveType() at the end of the CognigyScript expression to keep it as an object. For example, input.slots.city[0].preserveType() stores the Slot object for the first found city entity in the Context object.