Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - General
Unanswered

How to hide the adaptive card form after user click on Submit button

(0) ShareShare
ReportReport
Posted on by 21

Hi there,

 

I have a Power Virtual Agent bot to prompt for user input. I am using Bot Framework Composer to develop the adaptive card form. But after user click on the Submit button, the form will still appear in the Teams chat.

Is there any way to hide the adaptive card form after user click on Submit button?

 

BotForm.png

 

Code sample

# adaptivecardjson_StartUpdateForm(StaffName, StaffVendor, ARTDate, PCRDate, MOHProtocol, DateInOffice, FloorWorkstation, Recovered, RecoveryDate, ppCloseContact, OfficeArea)
- ```{
 "type": "AdaptiveCard",
 "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
 "version": "1.3",
 "body": [
 {
 "type": "TextBlock",
 "size": "Medium",
 "weight": "Bolder",
 "text": "Update Staff COVID-19 Positive Result",
 "wrap": true,
 "color": "Accent"
 },
 {
 "type": "Container",
 "items": [
 {
 "type": "FactSet",
 "facts": [
 {
 "title": "Staff Name",
 "value": "${StaffName}"
 },
 {
 "title": "Staff/Vendor",
 "value": "${StaffVendor}"
 },
 {
 "title": "ART Positive Date",
 "value": "${ARTDate}"
 },
 {
 "title": "PCR Positive Date",
 "value": "${PCRDate}"
 },
 {
 "title": "MOH Protocol",
 "value": "${MOHProtocol}"
 },
 {
 "title": "Date Last in Office",
 "value": "${DateInOffice}"
 },
 {
 "title": "Floor and Workstation",
 "value": "${FloorWorkstation}"
 }
 ]
 }
 ],
 "style": "emphasis"
 },
 {
 "type": "Input.ChoiceSet",
 "choices": [
 {
 "title": "Yes",
 "value": "Yes"
 },
 {
 "title": "No",
 "value": "No"
 }
 ],
 "label": "Recovered?",
 "style": "expanded",
 "id": "Recovered",
 "value": "${Recovered}",
 "separator": true,
 "isRequired": true
 },
 {
 "type": "Input.Date",
 "id": "RecoveryDate",
 "placeholder": "Enter a date",
 "label": "Recovery Date",
 "errorMessage": "This is a required input",
 "min": "2022-01-01",
 "value": "${RecoveryDate}"
 },
 {
 "label": "Close Contact",
 "type": "Input.ChoiceSet",
 "choices.data": {
 "type": "Data.Query",
 "dataset": "graph.microsoft.com/users"
 },
 "id": "ppCloseContact",
 "isMultiSelect": true,
 "value": "${ppCloseContact}"
 },
 {
 "type": "Input.Text",
 "placeholder": "Office Area Accessed (more than 15 mins)",
 "label": "Office Area Accessed (more than 15 mins)",
 "id": "OfficeArea",
 "value": "${OfficeArea}"
 }
 ],
 "actions": [
 {
 "type": "Action.Submit",
 "title": "SUBMIT"
 }
 ]
}```

 

Categories:
  • Viswav Profile Picture
    92 on at
    Re: How to hide the adaptive card form after user click on Submit button

    Tried so many ways and still can't figure this out 😕 

  • Sohom Rik Profile Picture
    49 on at
    Re: How to hide the adaptive card form after user click on Submit button

    Facing a similar scenario and seeking your advice. Any insights or guidance would be greatly appreciated.

  • bikashb Profile Picture
    23 on at
    Re: How to hide the adaptive card form after user click on Submit button

    Anyone was able to do this? I have same use case.

  • john_then Profile Picture
    21 on at
    Re: How to hide the adaptive card form after user click on Submit button

    Hi @Expiscornovus,

     

    Thanks for your prompt reply.

    I am using Bot Framework Composer and I am not sure how to add the code snippet above to hide the form.

     

    In addition, my PVA Chat bot is only published on MS Teams and not any other channels.

     

    Do you mind to provide me some example screenshots on the Bot Framework Composer?

  • Expiscornovus Profile Picture
    31,711 Most Valuable Professional on at
    Re: How to hide the adaptive card form after user click on Submit button

    Hi @john_then,

     

    I have found this thread on Github about disabling the card after an action. Worth having a look at that discussion:

    https://github.com/microsoft/BotFramework-WebChat/issues/1427

     

    In that thread they have shared the code snippet below. That might work, but I haven't been able to test it yet on my bots though 😄

    <Components.AdaptiveCardContent actionPerformedClassName="card__action--performed"
     content={attachment.content}
     disabled={recentBotMessage}
     />

     

    Hope this helps a bit?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Copilot Studio - General

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 25

#1
Pablo Roldan Profile Picture

Pablo Roldan 25

#3
stampcoin Profile Picture

stampcoin 10

Overall leaderboard