I want to open a URL through "Action.OpenUrl" in an AdaptiveCard and addtionally provide an "OK" Status to the bot, so the waterfall dialog can continue as supposed.
Important to know is that I want to deploy the bot on azure for MS Teams. So my first try was to "Action.Submit" the "OK" To the bot and open the URL from code through the System.Diagnostics.Process.Start(url). But it doesn't work like that on Windows 10 anymore and throws a "Directory not found" exceptions. There are some solutions for that problem that I tried. for example this one "here! This worked for me on the local Emulator but when deployed in MS Teams it just didn't do anything at all. So now I'm back to thinking about a nested "Action.XXX" possibility in the AdaptiveCard JSON that allows me to open the URL via OpenUrl function and on the same time gives the bot a signal like Submit function does. Has anyone ever had such a problem?
"actions": [
{
"type": "Action.Submit",
"title": "Alles OK",
"data": {
"msteams": {
"type": "imBack",
"value": "OK"
}
}
},
That is the Action Button right now in the adaptive card for MS Teams It should trigger the "OK" Case in the c# Bot code seen below and simultaneously open the url which can be added to a "Action.OpenUrl" Button
if (stepContext.Result is string promptResult)
{
switch (promptResult)
{
case "OK":
string url = CreateTicketResponses.CreateTicketLink(state.Summary, state.Description, state.Type);
System.Diagnostics.Process.Start(url);
//await stepContext.Context.SendActivityAsync(url);
state.Reset();
new DialogTurnResult(DialogTurnStatus.Complete);
return await stepContext.EndDialogAsync();
So as described above I want to get an adaptive card which opens the URL in a new browser tab (on any system that the user might have) and give the bot an indicator to End the dialog (EndDialogAsync()).
System.Diagnostics.Process.Start(url);
- isn't this going to run on the server?? – stuartd