is a construct for use inside AskFunction that asks for confirmation of the current value associated with "key" and allows this to be either confirmed or changed.


applies the function fun to determine how to ask for confirmation.


applies the string "str" as a string template to ask for confirmation.


  • AskConfirm returns the value associated with "key" when confirmation was accepted.
  • If confirmation is not accepted, AskConfirm["key"] effectively rewinds evaluation inside an AskFunction back to the previous time a value for "key" was requested.
  • In the context of the second argument of AskConfirm, the StringTemplate is applied with the association <|"key"->key, "value"->value|>.
  • AskConfirm["key"] is typically equivalent to AskConfirm["key","The current value of key `key` is `value`. Do you want to change it?"].


open allclose all

Basic Examples  (3)

AskConfirm can be used to rewind the evaluation to the point before a value was known:

Confirm the user's answer with a custom message:

Confirm the user's answer if it seems unlikely:

Properties & Relations  (1)

AskConfirm can be simulated by unsetting the value associated with a key:

Wolfram Research (2016), AskConfirm, Wolfram Language function,


Wolfram Research (2016), AskConfirm, Wolfram Language function,


@misc{reference.wolfram_2020_askconfirm, author="Wolfram Research", title="{AskConfirm}", year="2016", howpublished="\url{}", note=[Accessed: 05-March-2021 ]}


@online{reference.wolfram_2020_askconfirm, organization={Wolfram Research}, title={AskConfirm}, year={2016}, url={}, note=[Accessed: 05-March-2021 ]}


Wolfram Language. 2016. "AskConfirm." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2016). AskConfirm. Wolfram Language & System Documentation Center. Retrieved from