AskState[]
is a construct for use inside AskFunction that returns an association of all values in the current state of the AskFunction.
AskState
AskState[]
is a construct for use inside AskFunction that returns an association of all values in the current state of the AskFunction.
Details
- AskState[] gives an association of the form <|"key1"->value1,"key2"->value2,…|>, where the entries are in the order in which keys were first set in the operation of the AskFunction.
Examples
Basic Examples (2)
Retrieve all currently known values:
CloudDeploy[AskFunction[
Ask[{"name", "What's your name?"} -> "String"];
Ask[{"age", "How old are you?"} -> "Number"];
AskState[]
]]Use AskState to check on the number of questions answered:
CloudDeploy[AskFunction[Ask["x" -> "Number"];Ask["y" -> "Number"];
AskDisplay["You've entered " <> ToString[Length[AskState[]]] <> " numbers."]
]]See Also
Related Guides
Related Workflows
- Create a Conversational Interface
History
Text
Wolfram Research (2017), AskState, Wolfram Language function, https://reference.wolfram.com/language/ref/AskState.html.
CMS
Wolfram Language. 2017. "AskState." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AskState.html.
APA
Wolfram Language. (2017). AskState. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AskState.html
BibTeX
@misc{reference.wolfram_2026_askstate, author="Wolfram Research", title="{AskState}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/AskState.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_askstate, organization={Wolfram Research}, title={AskState}, year={2017}, url={https://reference.wolfram.com/language/ref/AskState.html}, note=[Accessed: 13-June-2026]}