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?
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"
}
]
}```
Tried so many ways and still can't figure this out 😕
Facing a similar scenario and seeking your advice. Any insights or guidance would be greatly appreciated.
Anyone was able to do this? I have same use case.
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?
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?
Romain The Low-Code...
25
Pablo Roldan
25
stampcoin
10