HowTo: Reference context parameters in a conversation

Official Content

When designing a chatbot Flow, it may be necessary to reference some context parameters.

You can reference the context parameters using the '&' character.

The context parameters can be used at any level of the Flow: On Error Messages property, Message conditions, User Input conditionsMessages, and Ask Messages property.

enlightened &GXUserInput is a standard variable used to reproduce the user input.

Example

In this example, you'll see how to reference the context output of a procedure executed to fulfill the Chatbot Intent of a Flow.

The context parameter will be used in the Messages returned after the execution of the flow.

Consider the following example, where we've defined a Flow whose related intent is to get debt refinancing information in a chatbot for assistance to citizens.
The Conversational Object associated with the Flow is the "DebtRefinancingInfo" procedure.

image_2018425103310_1_png

The "DebtRefinancingInfo" code is as follows. Note that it returns a variable called &FormalitiesRequirements:

parm(out:&FormalitiesRequirements);

for each FormalitiesDetails
    where FormalitiesReason = FormalitiesReason.DebtRefinancing
    &FormalitiesRequirements = FormalitiesRequirements
endfor

To return the complete output of the DebtRefinancingInfo procedure to the user, the Message Response defined in the Flow has the Messages Property set to &FormalitiesRequirements.

image_2018425104034_1_png

At runtime:

image_2018727135912_1_png

See also

HowTo: Build a chatbot using GeneXus

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.