Adaptive Cards Submit actions











up vote
4
down vote

favorite
1












I have generated an adaptive card using JSON format with two buttons submit and cancel which are returning a "messageBack" message as submit and cancel respectively.
I am using C# to access the reply but I am not able to figure out how to access the reply from the adaptive card.



My json is



    {
"type": "AdaptiveCard",
"selectAction": {
"type": "Action.Submit"
},
"body": [
{
"type": "TextBlock",
"horizontalAlignment": "Center",
"size": "Large",
"weight": "Bolder",
"color": "Accent",
"text": "Meeting Composer Create"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"horizontalAlignment": "Left",
"spacing": "Medium",
"size": "Medium",
"weight": "Bolder",
"color": "Accent",
"text": "Attendees:"
}
],
"width": "stretch"
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"id": "attendeeVal",
"text": "a"
}
],
"width": "stretch"
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"color": "Accent",
"text": "Subject:"
}
],
"width": "stretch"
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"id": "subVal",
"text": "meeting"
}
],
"width": "stretch"
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"color": "Accent",
"text": "Date:"
}
],
"width": "stretch"
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"id": "dateVal",
"text": "17/11/2018 10.30 AM"
}
],
"width": "stretch"
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"color": "Accent",
"text": "Document Name:"
}
],
"width": "stretch"
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"id": "docVal",
"text": "Document1"
}
],
"width": "stretch"
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"data": {
"msteams": {
"type": "messageBack",
"displayText": "I clicked this button",
"text": "text to bots",
"value": "Submit"
}
}
},
{
"type": "Action.Submit",
"title": "Cancel",
"data": {
"msteams": {
"type": "messageBack",
"displayText": "I clicked this button",
"text": "text to bots",
"value": "Cancel"
}
}
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}


my C# is



 var response = getCard(stepContext, "Aditya Rao, Vishal Subramaniam" , "Scrum Meeting" , "17/11/1028, 10:30AM" , "Scrum Sprint.pptx");
await stepContext.Context.SendActivityAsync(response).ConfigureAwait(false);


my additional function to support are



private static Attachment CreateAdaptiveCardAttachment(string filePath, string names, string subj , string datee, string docs)
{
var adaptiveCardJson = File.ReadAllText(filePath);
dynamic obj = JsonConvert.DeserializeObject(adaptiveCardJson);
obj["body"][1]["columns"][1]["items"][0]["text"] = names;
obj["body"][2]["columns"][1]["items"][0]["text"] = subj;
obj["body"][3]["columns"][1]["items"][0]["text"] = datee;
obj["body"][4]["columns"][1]["items"][0]["text"] = docs;
var adaptiveCardAttachment = new Attachment()
{
ContentType = "application/vnd.microsoft.card.adaptive",
Content = obj,
};
return adaptiveCardAttachment;
}


// Create an attachment message response.
private Activity CreateResponse(Activity activity, Attachment attachment)
{
var response = activity.CreateReply();
response.Attachments = new List<Attachment>() { attachment };
return response;
}


private Activity getCard(WaterfallStepContext stepContext, string names, string subj , string datee, string docs)
{
var jsonFilePath = @".DialogsCardTemplatesMeetingComposerCreate.json";
var activity = stepContext.Context.Activity;
var adCard = CreateAdaptiveCardAttachment(jsonFilePath,names,subj,datee,docs);
var response = CreateResponse(activity, adCard);
return response;
}


How do I access the values response once submit or cancel is clicked?



Also if someone can help me find how to get reply from input.choice to get the checkbox data of the selected cards.










share|improve this question




























    up vote
    4
    down vote

    favorite
    1












    I have generated an adaptive card using JSON format with two buttons submit and cancel which are returning a "messageBack" message as submit and cancel respectively.
    I am using C# to access the reply but I am not able to figure out how to access the reply from the adaptive card.



    My json is



        {
    "type": "AdaptiveCard",
    "selectAction": {
    "type": "Action.Submit"
    },
    "body": [
    {
    "type": "TextBlock",
    "horizontalAlignment": "Center",
    "size": "Large",
    "weight": "Bolder",
    "color": "Accent",
    "text": "Meeting Composer Create"
    },
    {
    "type": "ColumnSet",
    "columns": [
    {
    "type": "Column",
    "items": [
    {
    "type": "TextBlock",
    "horizontalAlignment": "Left",
    "spacing": "Medium",
    "size": "Medium",
    "weight": "Bolder",
    "color": "Accent",
    "text": "Attendees:"
    }
    ],
    "width": "stretch"
    },
    {
    "type": "Column",
    "items": [
    {
    "type": "TextBlock",
    "id": "attendeeVal",
    "text": "a"
    }
    ],
    "width": "stretch"
    }
    ]
    },
    {
    "type": "ColumnSet",
    "columns": [
    {
    "type": "Column",
    "items": [
    {
    "type": "TextBlock",
    "size": "Medium",
    "weight": "Bolder",
    "color": "Accent",
    "text": "Subject:"
    }
    ],
    "width": "stretch"
    },
    {
    "type": "Column",
    "items": [
    {
    "type": "TextBlock",
    "id": "subVal",
    "text": "meeting"
    }
    ],
    "width": "stretch"
    }
    ]
    },
    {
    "type": "ColumnSet",
    "columns": [
    {
    "type": "Column",
    "items": [
    {
    "type": "TextBlock",
    "size": "Medium",
    "weight": "Bolder",
    "color": "Accent",
    "text": "Date:"
    }
    ],
    "width": "stretch"
    },
    {
    "type": "Column",
    "items": [
    {
    "type": "TextBlock",
    "id": "dateVal",
    "text": "17/11/2018 10.30 AM"
    }
    ],
    "width": "stretch"
    }
    ]
    },
    {
    "type": "ColumnSet",
    "columns": [
    {
    "type": "Column",
    "items": [
    {
    "type": "TextBlock",
    "size": "Medium",
    "weight": "Bolder",
    "color": "Accent",
    "text": "Document Name:"
    }
    ],
    "width": "stretch"
    },
    {
    "type": "Column",
    "items": [
    {
    "type": "TextBlock",
    "id": "docVal",
    "text": "Document1"
    }
    ],
    "width": "stretch"
    }
    ]
    }
    ],
    "actions": [
    {
    "type": "Action.Submit",
    "title": "Submit",
    "data": {
    "msteams": {
    "type": "messageBack",
    "displayText": "I clicked this button",
    "text": "text to bots",
    "value": "Submit"
    }
    }
    },
    {
    "type": "Action.Submit",
    "title": "Cancel",
    "data": {
    "msteams": {
    "type": "messageBack",
    "displayText": "I clicked this button",
    "text": "text to bots",
    "value": "Cancel"
    }
    }
    }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.0"
    }


    my C# is



     var response = getCard(stepContext, "Aditya Rao, Vishal Subramaniam" , "Scrum Meeting" , "17/11/1028, 10:30AM" , "Scrum Sprint.pptx");
    await stepContext.Context.SendActivityAsync(response).ConfigureAwait(false);


    my additional function to support are



    private static Attachment CreateAdaptiveCardAttachment(string filePath, string names, string subj , string datee, string docs)
    {
    var adaptiveCardJson = File.ReadAllText(filePath);
    dynamic obj = JsonConvert.DeserializeObject(adaptiveCardJson);
    obj["body"][1]["columns"][1]["items"][0]["text"] = names;
    obj["body"][2]["columns"][1]["items"][0]["text"] = subj;
    obj["body"][3]["columns"][1]["items"][0]["text"] = datee;
    obj["body"][4]["columns"][1]["items"][0]["text"] = docs;
    var adaptiveCardAttachment = new Attachment()
    {
    ContentType = "application/vnd.microsoft.card.adaptive",
    Content = obj,
    };
    return adaptiveCardAttachment;
    }


    // Create an attachment message response.
    private Activity CreateResponse(Activity activity, Attachment attachment)
    {
    var response = activity.CreateReply();
    response.Attachments = new List<Attachment>() { attachment };
    return response;
    }


    private Activity getCard(WaterfallStepContext stepContext, string names, string subj , string datee, string docs)
    {
    var jsonFilePath = @".DialogsCardTemplatesMeetingComposerCreate.json";
    var activity = stepContext.Context.Activity;
    var adCard = CreateAdaptiveCardAttachment(jsonFilePath,names,subj,datee,docs);
    var response = CreateResponse(activity, adCard);
    return response;
    }


    How do I access the values response once submit or cancel is clicked?



    Also if someone can help me find how to get reply from input.choice to get the checkbox data of the selected cards.










    share|improve this question


























      up vote
      4
      down vote

      favorite
      1









      up vote
      4
      down vote

      favorite
      1






      1





      I have generated an adaptive card using JSON format with two buttons submit and cancel which are returning a "messageBack" message as submit and cancel respectively.
      I am using C# to access the reply but I am not able to figure out how to access the reply from the adaptive card.



      My json is



          {
      "type": "AdaptiveCard",
      "selectAction": {
      "type": "Action.Submit"
      },
      "body": [
      {
      "type": "TextBlock",
      "horizontalAlignment": "Center",
      "size": "Large",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Meeting Composer Create"
      },
      {
      "type": "ColumnSet",
      "columns": [
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "horizontalAlignment": "Left",
      "spacing": "Medium",
      "size": "Medium",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Attendees:"
      }
      ],
      "width": "stretch"
      },
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "id": "attendeeVal",
      "text": "a"
      }
      ],
      "width": "stretch"
      }
      ]
      },
      {
      "type": "ColumnSet",
      "columns": [
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "size": "Medium",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Subject:"
      }
      ],
      "width": "stretch"
      },
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "id": "subVal",
      "text": "meeting"
      }
      ],
      "width": "stretch"
      }
      ]
      },
      {
      "type": "ColumnSet",
      "columns": [
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "size": "Medium",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Date:"
      }
      ],
      "width": "stretch"
      },
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "id": "dateVal",
      "text": "17/11/2018 10.30 AM"
      }
      ],
      "width": "stretch"
      }
      ]
      },
      {
      "type": "ColumnSet",
      "columns": [
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "size": "Medium",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Document Name:"
      }
      ],
      "width": "stretch"
      },
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "id": "docVal",
      "text": "Document1"
      }
      ],
      "width": "stretch"
      }
      ]
      }
      ],
      "actions": [
      {
      "type": "Action.Submit",
      "title": "Submit",
      "data": {
      "msteams": {
      "type": "messageBack",
      "displayText": "I clicked this button",
      "text": "text to bots",
      "value": "Submit"
      }
      }
      },
      {
      "type": "Action.Submit",
      "title": "Cancel",
      "data": {
      "msteams": {
      "type": "messageBack",
      "displayText": "I clicked this button",
      "text": "text to bots",
      "value": "Cancel"
      }
      }
      }
      ],
      "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
      "version": "1.0"
      }


      my C# is



       var response = getCard(stepContext, "Aditya Rao, Vishal Subramaniam" , "Scrum Meeting" , "17/11/1028, 10:30AM" , "Scrum Sprint.pptx");
      await stepContext.Context.SendActivityAsync(response).ConfigureAwait(false);


      my additional function to support are



      private static Attachment CreateAdaptiveCardAttachment(string filePath, string names, string subj , string datee, string docs)
      {
      var adaptiveCardJson = File.ReadAllText(filePath);
      dynamic obj = JsonConvert.DeserializeObject(adaptiveCardJson);
      obj["body"][1]["columns"][1]["items"][0]["text"] = names;
      obj["body"][2]["columns"][1]["items"][0]["text"] = subj;
      obj["body"][3]["columns"][1]["items"][0]["text"] = datee;
      obj["body"][4]["columns"][1]["items"][0]["text"] = docs;
      var adaptiveCardAttachment = new Attachment()
      {
      ContentType = "application/vnd.microsoft.card.adaptive",
      Content = obj,
      };
      return adaptiveCardAttachment;
      }


      // Create an attachment message response.
      private Activity CreateResponse(Activity activity, Attachment attachment)
      {
      var response = activity.CreateReply();
      response.Attachments = new List<Attachment>() { attachment };
      return response;
      }


      private Activity getCard(WaterfallStepContext stepContext, string names, string subj , string datee, string docs)
      {
      var jsonFilePath = @".DialogsCardTemplatesMeetingComposerCreate.json";
      var activity = stepContext.Context.Activity;
      var adCard = CreateAdaptiveCardAttachment(jsonFilePath,names,subj,datee,docs);
      var response = CreateResponse(activity, adCard);
      return response;
      }


      How do I access the values response once submit or cancel is clicked?



      Also if someone can help me find how to get reply from input.choice to get the checkbox data of the selected cards.










      share|improve this question















      I have generated an adaptive card using JSON format with two buttons submit and cancel which are returning a "messageBack" message as submit and cancel respectively.
      I am using C# to access the reply but I am not able to figure out how to access the reply from the adaptive card.



      My json is



          {
      "type": "AdaptiveCard",
      "selectAction": {
      "type": "Action.Submit"
      },
      "body": [
      {
      "type": "TextBlock",
      "horizontalAlignment": "Center",
      "size": "Large",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Meeting Composer Create"
      },
      {
      "type": "ColumnSet",
      "columns": [
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "horizontalAlignment": "Left",
      "spacing": "Medium",
      "size": "Medium",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Attendees:"
      }
      ],
      "width": "stretch"
      },
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "id": "attendeeVal",
      "text": "a"
      }
      ],
      "width": "stretch"
      }
      ]
      },
      {
      "type": "ColumnSet",
      "columns": [
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "size": "Medium",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Subject:"
      }
      ],
      "width": "stretch"
      },
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "id": "subVal",
      "text": "meeting"
      }
      ],
      "width": "stretch"
      }
      ]
      },
      {
      "type": "ColumnSet",
      "columns": [
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "size": "Medium",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Date:"
      }
      ],
      "width": "stretch"
      },
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "id": "dateVal",
      "text": "17/11/2018 10.30 AM"
      }
      ],
      "width": "stretch"
      }
      ]
      },
      {
      "type": "ColumnSet",
      "columns": [
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "size": "Medium",
      "weight": "Bolder",
      "color": "Accent",
      "text": "Document Name:"
      }
      ],
      "width": "stretch"
      },
      {
      "type": "Column",
      "items": [
      {
      "type": "TextBlock",
      "id": "docVal",
      "text": "Document1"
      }
      ],
      "width": "stretch"
      }
      ]
      }
      ],
      "actions": [
      {
      "type": "Action.Submit",
      "title": "Submit",
      "data": {
      "msteams": {
      "type": "messageBack",
      "displayText": "I clicked this button",
      "text": "text to bots",
      "value": "Submit"
      }
      }
      },
      {
      "type": "Action.Submit",
      "title": "Cancel",
      "data": {
      "msteams": {
      "type": "messageBack",
      "displayText": "I clicked this button",
      "text": "text to bots",
      "value": "Cancel"
      }
      }
      }
      ],
      "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
      "version": "1.0"
      }


      my C# is



       var response = getCard(stepContext, "Aditya Rao, Vishal Subramaniam" , "Scrum Meeting" , "17/11/1028, 10:30AM" , "Scrum Sprint.pptx");
      await stepContext.Context.SendActivityAsync(response).ConfigureAwait(false);


      my additional function to support are



      private static Attachment CreateAdaptiveCardAttachment(string filePath, string names, string subj , string datee, string docs)
      {
      var adaptiveCardJson = File.ReadAllText(filePath);
      dynamic obj = JsonConvert.DeserializeObject(adaptiveCardJson);
      obj["body"][1]["columns"][1]["items"][0]["text"] = names;
      obj["body"][2]["columns"][1]["items"][0]["text"] = subj;
      obj["body"][3]["columns"][1]["items"][0]["text"] = datee;
      obj["body"][4]["columns"][1]["items"][0]["text"] = docs;
      var adaptiveCardAttachment = new Attachment()
      {
      ContentType = "application/vnd.microsoft.card.adaptive",
      Content = obj,
      };
      return adaptiveCardAttachment;
      }


      // Create an attachment message response.
      private Activity CreateResponse(Activity activity, Attachment attachment)
      {
      var response = activity.CreateReply();
      response.Attachments = new List<Attachment>() { attachment };
      return response;
      }


      private Activity getCard(WaterfallStepContext stepContext, string names, string subj , string datee, string docs)
      {
      var jsonFilePath = @".DialogsCardTemplatesMeetingComposerCreate.json";
      var activity = stepContext.Context.Activity;
      var adCard = CreateAdaptiveCardAttachment(jsonFilePath,names,subj,datee,docs);
      var response = CreateResponse(activity, adCard);
      return response;
      }


      How do I access the values response once submit or cancel is clicked?



      Also if someone can help me find how to get reply from input.choice to get the checkbox data of the selected cards.







      c# adaptive-cards






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 at 4:59

























      asked Nov 19 at 15:41









      Shubh Mehta

      213




      213
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote














          How do I access the values response once submit or cancel is clicked?




          We can get the value that user submit from adaptive card via Activity.Value property.



          if(turnContext.Activity.Value!= null)
          {

          reply.Text = $"submit data: {turnContext.Activity.Value}";

          }


          Test Result:



          enter image description here



          Output in emulator:



          enter image description here




          Also if someone can help me find how to get reply from input.choice to get the checkbox data of the selected cards.




          To display choice options for user selecting and get the selected option, you can refer to the following code snippet.



          In json file:



          {
          "type": "Input.ChoiceSet",
          "id": "optionSelection",
          "isMultiSelect": true,
          "style": "compact",
          "choices": [
          {
          "title": "option1",
          "value": "option1"
          },
          {
          "title": "option2",
          "value": "option2"
          },
          {
          "title": "option3",
          "value": "option3"
          }
          ]
          }


          Using same code to get user's selection:



          reply.Text = $"submit data: {turnContext.Activity.Value}";


          Test Result:



          enter image description here






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378090%2fadaptive-cards-submit-actions%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote














            How do I access the values response once submit or cancel is clicked?




            We can get the value that user submit from adaptive card via Activity.Value property.



            if(turnContext.Activity.Value!= null)
            {

            reply.Text = $"submit data: {turnContext.Activity.Value}";

            }


            Test Result:



            enter image description here



            Output in emulator:



            enter image description here




            Also if someone can help me find how to get reply from input.choice to get the checkbox data of the selected cards.




            To display choice options for user selecting and get the selected option, you can refer to the following code snippet.



            In json file:



            {
            "type": "Input.ChoiceSet",
            "id": "optionSelection",
            "isMultiSelect": true,
            "style": "compact",
            "choices": [
            {
            "title": "option1",
            "value": "option1"
            },
            {
            "title": "option2",
            "value": "option2"
            },
            {
            "title": "option3",
            "value": "option3"
            }
            ]
            }


            Using same code to get user's selection:



            reply.Text = $"submit data: {turnContext.Activity.Value}";


            Test Result:



            enter image description here






            share|improve this answer

























              up vote
              0
              down vote














              How do I access the values response once submit or cancel is clicked?




              We can get the value that user submit from adaptive card via Activity.Value property.



              if(turnContext.Activity.Value!= null)
              {

              reply.Text = $"submit data: {turnContext.Activity.Value}";

              }


              Test Result:



              enter image description here



              Output in emulator:



              enter image description here




              Also if someone can help me find how to get reply from input.choice to get the checkbox data of the selected cards.




              To display choice options for user selecting and get the selected option, you can refer to the following code snippet.



              In json file:



              {
              "type": "Input.ChoiceSet",
              "id": "optionSelection",
              "isMultiSelect": true,
              "style": "compact",
              "choices": [
              {
              "title": "option1",
              "value": "option1"
              },
              {
              "title": "option2",
              "value": "option2"
              },
              {
              "title": "option3",
              "value": "option3"
              }
              ]
              }


              Using same code to get user's selection:



              reply.Text = $"submit data: {turnContext.Activity.Value}";


              Test Result:



              enter image description here






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote










                How do I access the values response once submit or cancel is clicked?




                We can get the value that user submit from adaptive card via Activity.Value property.



                if(turnContext.Activity.Value!= null)
                {

                reply.Text = $"submit data: {turnContext.Activity.Value}";

                }


                Test Result:



                enter image description here



                Output in emulator:



                enter image description here




                Also if someone can help me find how to get reply from input.choice to get the checkbox data of the selected cards.




                To display choice options for user selecting and get the selected option, you can refer to the following code snippet.



                In json file:



                {
                "type": "Input.ChoiceSet",
                "id": "optionSelection",
                "isMultiSelect": true,
                "style": "compact",
                "choices": [
                {
                "title": "option1",
                "value": "option1"
                },
                {
                "title": "option2",
                "value": "option2"
                },
                {
                "title": "option3",
                "value": "option3"
                }
                ]
                }


                Using same code to get user's selection:



                reply.Text = $"submit data: {turnContext.Activity.Value}";


                Test Result:



                enter image description here






                share|improve this answer













                How do I access the values response once submit or cancel is clicked?




                We can get the value that user submit from adaptive card via Activity.Value property.



                if(turnContext.Activity.Value!= null)
                {

                reply.Text = $"submit data: {turnContext.Activity.Value}";

                }


                Test Result:



                enter image description here



                Output in emulator:



                enter image description here




                Also if someone can help me find how to get reply from input.choice to get the checkbox data of the selected cards.




                To display choice options for user selecting and get the selected option, you can refer to the following code snippet.



                In json file:



                {
                "type": "Input.ChoiceSet",
                "id": "optionSelection",
                "isMultiSelect": true,
                "style": "compact",
                "choices": [
                {
                "title": "option1",
                "value": "option1"
                },
                {
                "title": "option2",
                "value": "option2"
                },
                {
                "title": "option3",
                "value": "option3"
                }
                ]
                }


                Using same code to get user's selection:



                reply.Text = $"submit data: {turnContext.Activity.Value}";


                Test Result:



                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 at 11:16









                Fei Han

                10.1k1619




                10.1k1619






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53378090%2fadaptive-cards-submit-actions%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                    Alcedinidae

                    Origin of the phrase “under your belt”?