{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/453","repository_url":"https://api.github.com/repos/Microsoft/BotBuilder","labels_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/453/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/453/comments","events_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/453/events","html_url":"https://github.com/Microsoft/BotBuilder/issues/453","id":159128819,"number":453,"title":"PromptDialog for an undetermined number of questions [C#]","user":{"login":"stevienewell","id":6524855,"avatar_url":"https://avatars.githubusercontent.com/u/6524855?v=3","gravatar_id":"","url":"https://api.github.com/users/stevienewell","html_url":"https://github.com/stevienewell","followers_url":"https://api.github.com/users/stevienewell/followers","following_url":"https://api.github.com/users/stevienewell/following{/other_user}","gists_url":"https://api.github.com/users/stevienewell/gists{/gist_id}","starred_url":"https://api.github.com/users/stevienewell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevienewell/subscriptions","organizations_url":"https://api.github.com/users/stevienewell/orgs","repos_url":"https://api.github.com/users/stevienewell/repos","events_url":"https://api.github.com/users/stevienewell/events{/privacy}","received_events_url":"https://api.github.com/users/stevienewell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"chrimc62","id":17637681,"avatar_url":"https://avatars.githubusercontent.com/u/17637681?v=3","gravatar_id":"","url":"https://api.github.com/users/chrimc62","html_url":"https://github.com/chrimc62","followers_url":"https://api.github.com/users/chrimc62/followers","following_url":"https://api.github.com/users/chrimc62/following{/other_user}","gists_url":"https://api.github.com/users/chrimc62/gists{/gist_id}","starred_url":"https://api.github.com/users/chrimc62/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrimc62/subscriptions","organizations_url":"https://api.github.com/users/chrimc62/orgs","repos_url":"https://api.github.com/users/chrimc62/repos","events_url":"https://api.github.com/users/chrimc62/events{/privacy}","received_events_url":"https://api.github.com/users/chrimc62/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-06-08T10:18:21Z","updated_at":"2016-06-08T19:40:38Z","closed_at":null,"body":"I am attempting to write a bot which would allow users to create a request (Example. _I want to buy a t-shirt_ or _I want to fix my computer_ ). Depending on the request they pick, they will be asked a series of questions associated with that request; the questions are related directly to the request they choose. Currently I am attempting to iterate through this list of questions and use the PromptDialog.Text method to get the answers. However, this only asks the last question in the List and when an answer is given I get an error with _invalid need: expected Wait, have Done_ as the message. \r\n\r\n ```\r\nprivate async Task ListOfferings(IDialogContext context, IAwaitable<string> result)\r\n{\r\n   string name = await result;\r\n   var offerings = Offerings.Where((x) =>          \r\n      CultureInfo.CurrentCulture.CompareInfo.IndexOf(x.Name, name, \r\n      CompareOptions.IgnoreCase) >= 0\r\n    );\r\n   if (offerings.Count() != 0)\r\n   {\r\n      PromptDialog.Choice(context, CreateOffering, offerings, \"Which of these would you like?\");\r\n    }\r\n    else\r\n    {\r\n       await context.PostAsync(string.Format(\"Could not find an offering with name {0}\", name));\r\n       context.Wait(MessageReceived);\r\n     }\r\n}\r\n```\r\n\r\n```\r\nprivate async Task CreateOffering(IDialogContext context, IAwaitable<Offering> result)\r\n{\r\n   var offering = result.GetAwaiter().GetResult();\r\n   await context.PostAsync(string.Format(\"***CREATING {0}***\", offering.Name.ToUpper()));\r\n       \r\n   foreach (var question in offering.Questions)\r\n   {\r\n      PromptDialog.Text(context, null, question.Question);\r\n    }\r\n}\r\n```\r\n\r\nIs it possible to do something like this, where I want to dynamically decide the questions the user will be asked at runtime or am I required to take a more static, scripted approach?"},"comment":{"url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/comments/224704484","html_url":"https://github.com/Microsoft/BotBuilder/issues/453#issuecomment-224704484","issue_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/453","id":224704484,"user":{"login":"willportnoy","id":17912714,"avatar_url":"https://avatars.githubusercontent.com/u/17912714?v=3","gravatar_id":"","url":"https://api.github.com/users/willportnoy","html_url":"https://github.com/willportnoy","followers_url":"https://api.github.com/users/willportnoy/followers","following_url":"https://api.github.com/users/willportnoy/following{/other_user}","gists_url":"https://api.github.com/users/willportnoy/gists{/gist_id}","starred_url":"https://api.github.com/users/willportnoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willportnoy/subscriptions","organizations_url":"https://api.github.com/users/willportnoy/orgs","repos_url":"https://api.github.com/users/willportnoy/repos","events_url":"https://api.github.com/users/willportnoy/events{/privacy}","received_events_url":"https://api.github.com/users/willportnoy/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T19:40:38Z","updated_at":"2016-06-08T19:40:38Z","body":"You can't really call PromptDialog.Text in a loop like that - you should call it once, then let it return a result to the ResumeAfter handler (which you shouldn't pass null to).  You can still do that in a data-driven way, by still \"looping\" over your questions, one by one, and initiating just a single text prompt at a time."}}
{"actor":{"display_login":"willportnoy"}}