Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit Button Behavior in Consecutive Adaptive Cards #9099

Open
ritwickbhargav80 opened this issue Jan 29, 2025 · 5 comments
Open

Submit Button Behavior in Consecutive Adaptive Cards #9099

ritwickbhargav80 opened this issue Jan 29, 2025 · 5 comments

Comments

@ritwickbhargav80
Copy link

Discussed in #9097

Originally posted by ritwickbhargav80 January 25, 2025
I'm encountering an issue in Microsoft Copilot Studio where the submit button on a previous adaptive card inadvertently triggers the submission of subsequent adaptive cards.

Detailed Issue:
When multiple adaptive cards are present in a conversation flow:

  • Let's say the bot presents one adaptive card.
  • Upon submitting that adaptive card there is another adaptive card for confirmation let's call it second adaptive card.
  • If I click the submit button on the first adaptive card again; it submits the second adaptive card.
  • This unexpected behavior leads to unintended actions or data submissions.

Steps to Reproduce:

  1. Create a new Agent in Microsoft Copilot Studio.
  2. Create another topic as "Order Products" (Here is the YAML code: https://codefile.io/f/N0wXWGNmIk)
  3. Type "Order Products" in Test your agent pane
  4. It should display you an adaptive card as "Product Order Form"
  5. You fill that form and click on "Next" button
  6. It should display you another adaptive card as "Order Confirmation"
  7. Don't click on any of the button present in "Order Confirmation" adaptive card and click on the "Next" button of "Product Order Form"
  8. You'll see it bypasses that confirmation and moves to "All Other Conditions" scenario

Expected Behaviour:

  • The submit button on each adaptive card should only trigger the submission of data associated with that specific card.
  • Subsequent adaptive cards should only be submitted when their respective submit buttons are clicked.

Queries:

  • I would like to know if this behavior is intended or if there's a way to disable or control the submission behavior of previous adaptive cards from Adaptive Card or Microsoft Copilot Studio?
  • If this functionality is not yet available, are there any recommended best practices, alternative approaches or workarounds to handle this scenario with Adaptive Cards or from the Microsoft Copilot Studio?
@Nivedipa-MSFT
Copy link

Nivedipa-MSFT commented Jan 29, 2025

@ritwickbhargav80 - Thank you for bringing this issue to our attention.
The issue you’re encountering with the adaptive cards in Microsoft Copilot Studio, where the submit button on a previous adaptive card inadvertently triggers the submission of subsequent adaptive cards, is not the expected behavior. Each adaptive card’s submit action should be isolated to that specific card. Here are some steps and recommendations to control the submission behavior:

Could you please verify the below points:
Isolate Submit Actions: Ensure that each adaptive card has its own unique id and action handlers. This can help ensure that the submit action on one card does not interfere with another.

Use AdaptiveSubmitAction with Unique Data: When defining the AdaptiveSubmitAction for each card, include unique identifiers or data payloads that can help differentiate between the cards during submission.

Check for Event Handling Logic: Verify the event handling logic in your bot to ensure that submit actions are being processed correctly and are not inadvertently affecting other cards.

Debug and Log: Add detailed logging to your bot’s event handling code to capture the sequence of actions and identify where the unintended submissions are occurring.

Please let us know if you have any further query here.

@Nivedipa-MSFT
Copy link

@ritwickbhargav80 - Have you verified the above suggested points or are you still facing this issue?

@ritwickbhargav80
Copy link
Author

Hi @Nivedipa-MSFT ,

Isolated Submit Actions: Yes we've Isolated Submit Actions. Even we tried segregation of Adaptive cards in different topics (for ex: Adaptive Card 1 in one topic and Adaptive Card 2 in another topic) but that doesn't work as well. The previous adaptive card submit behaviour interferes with the next adaptive card.

Use AdaptiveSubmitAction with Unique Data: Are you suggesting we need to add a condition to check which actionSubmitId is getting submitted every time and in every flow? In my opinion, either the previous button of Adaptive Card should be disabled or shouldn't have any effect.

FYI, I've added the code as well for Microsoft Copilot Studio to replicate my scenario.

So, the expected flow is like the following:

  1. User Intent Identified as "Order product"
  2. ADAPTIVE CARD 1: Show an adaptive card to capture user's product input
  3. ADAPTIVE CARD 2: Take confirmation from the user whether he wasn't to place an order.
  4. Based on submission from ADAPTIVE CARD 2 the bot should send a message
  5. Once the ADAPTIVE CARD 2 has been rendered; even if the user click on submit action of ADAPTIVE CARD 1; it shouldn't have any effect.

Currently the issue lies in Step 5 of expected flow which allows the bot to bypass the ADAPTIVE CARD 2 submission if user clicks on submit action of ADAPTIVE CARD 1.

Thanks!

@Nivedipa-MSFT
Copy link

We will check and update you soon.

@Nivedipa-MSFT
Copy link

Hello @ritwickbhargav80 - We are having trouble repro'ing this issue. Could you please help providing repro video or deployed app, so that it would be easier for us to investigate and raise a bug accordingly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants