From the documentation for Ask
:
The first time Ask["key"] occurs in the evaluation of AskFunction[{[Ellipsis],"key"->spec,[Ellipsis]},body], a value associated with "key" is interactively requested using the form and interpretation specified by spec. Subsequent evaluations of Ask["key"] return the stored value.
I haven't used the various Ask*
functions, and I notice that they are labeled as experimental, so I don't have any advice on using them. However, I have used FormFunction
and related functions. You can use them to create fairly complex input forms for getting data from a user. Here is a quick example from the documentation that shows how to use a sort of expandable input widget to get a list of values:
FormFunction["field" -> RepeatingElement["String"]][]
These functions are typically deployed (with CloudDeploy
) as a web resource. If you're just wanting interaction in a local notebook, you could look at Input
, InputString
, or similar functions.