1

"adaptivecards": "^1.2.6",

We are using adaptivecards package with bot framework in spfx solution. Reference link: https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-adaptivecards

Details Data is getting wiped out once submit action taken on adaptive card. We are using below adaptive card package: "adaptivecards": "^1.2.6",

Issue a. When a user provides inputs to cards all data are seen whatever user has provided as input. b. As soon as a user submits an action button on that, a request is submitted to bot with all user input data. c. An issue is all user input data are wiped out.

Before Submiting Card: enter image description here

After submit card get reset

Jaya Raut
  • 21
  • 6
  • @Kyle Delaney Can you help with this – Jaya Raut Mar 08 '21 at 09:41
  • I'm afraid you cannot @ mention people who are not already in the conversation. You don't need to anyway, since my team will see all questions that have the [tag:botframework] tag. What made you think to @ mention me specifically? – Kyle Delaney Mar 09 '21 at 00:57
  • About your question, it sounds like you're describing the behavior formerly seen in Teams where Adaptive Card input values get reset on submit. Can you please edit some screenshots into your question so that we can be sure of what you're talking about? – Kyle Delaney Mar 09 '21 at 00:57
  • Hi Kyle, We thought you might be best person to reach out to for issue we are facing, so we mentioned you. Apologies if it bothers. – Jaya Raut Mar 10 '21 at 02:20
  • About issue, We have integrated bot in SharePoint using spfx bot extension ( botframework-webchat version 4.4, adaptive cards version 1.2.6). Where on submit action adaptive cards getting reset. Is this expected behaviour? If so, How can we retain its values on submit action. – Jaya Raut Mar 10 '21 at 02:28
  • As far as I know this was never a behavior in Web Chat, but I do notice that you're using a very old Web Chat version. Can you try updating to the latest version to see if that helps? I'm afraid I don't know anything about Sharepoint and the instructions on the GitHub page aren't sufficient for me to run the sample, so if you'd like me to reproduce this on my end then you'll need to post links in order to teach me how to set up an spfx solution from scratch. When I try any form of Web Chat, I don't see the behavior you're describing. – Kyle Delaney Mar 11 '21 at 22:50
  • Hi Kyle, we are using specified version of botframework-webchat due to its compatibility with spfx. You can Integrate Bot in sharepoint using below link :https://www.withum.com/resources/build-a-custom-chat-bot-with-sharepoint-framework/. – Jaya Raut Mar 15 '21 at 04:28
  • I'm sorry but this is pretty far outside my area of expertise. I'm much more of a Bot Framework person than a SharePoint person. In order for me to help, would you be willing to create a minimal example by running your Web Chat on its own page outside of SharePoint and seeing if you can still reproduce the issue? If you can reproduce the issue outside of SharePoint then that would indicate that the issue is not SharePoint-related – Kyle Delaney Mar 18 '21 at 23:23
  • Are you still working on this? – Kyle Delaney Mar 30 '21 at 23:00
  • Hi Kyle, Yes I am working on this. This seems to be expected behaviour. – Jaya Raut Apr 01 '21 at 07:41
  • I am trying to store data on submission of adaptive card. And updating it with values on re-render. – Jaya Raut Apr 01 '21 at 07:42
  • This is expected behavior in Teams, but not in Web Chat. Did you try running Web Chat outside of SharePoint like I asked you to? – Kyle Delaney Apr 05 '21 at 20:06
  • Do you still need help? – Kyle Delaney Apr 08 '21 at 18:48
  • I am able to retain data on adaptive card. What i am doing is: On submission of card storing values and on re-render passing that values by comparing id of card. – Jaya Raut Apr 09 '21 at 06:26
  • Well you shouldn't have to do that in Web Chat because the values aren't supposed to disappear by default. But are you saying you're satisfied with this solution? Would you like to post that as an answer? – Kyle Delaney Apr 09 '21 at 16:29
  • Yes. I am satisfied with solution. – Jaya Raut Apr 12 '21 at 06:28
  • Would you like to post that as an answer so you can accept it? – Kyle Delaney Apr 12 '21 at 14:52

1 Answers1

0

This isn't a thing that happens in Web Chat. It used to be a thing that happens in Teams, but it seems like they changed the Teams behavior a while ago. The only reason this could happen in Web Chat is if you wrote custom code to make it happen in Web Chat. Out of the box, Web Chat simply doesn't have this problem.

My recommendation is to remove the code that's resetting your input fields. Failing that, you can write new code to set the input fields based on the submitted data.

Kyle Delaney
  • 11,616
  • 6
  • 39
  • 66