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

Suggested actions not working properly with choice action. #6645

Open
14 tasks
GreatHavoc opened this issue May 1, 2024 · 1 comment
Open
14 tasks

Suggested actions not working properly with choice action. #6645

GreatHavoc opened this issue May 1, 2024 · 1 comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@GreatHavoc
Copy link

GreatHavoc commented May 1, 2024

Version

Bot Framework Python SDK.
botbuilder-core==4.14.8
botbuilder-dialogs==4.14.8
botbuilder-schema==4.14.8
botframework-connector==4.14.8
botframework-streaming==4.14.8

Describe the bug

IDEA: I want to show the option to the user on the bot webchat where he will click to open a link and come back to bot again to continue the flow.

Issue: I am using the prompt to show the user suggested actions and added the action to the choices of the prompt but the issue is after clicking on the suggested action the link opens but i didn't get any response that the button is clicked because of that i can't continue the flow without knowing what isd clicked or selected by the user.

Reference Code:
return await step_context.prompt(ChoicePrompt.name,PromptOptions(
style=ListStyle.suggested_action,
choices=[Choice("Link1"),Choice("Link2"),Choice('Link3',action=CardAction(title="Track Credit Card Application",type="openUrl",value="https://xyz.com")),Choice("Apply Now For Credit Card",action=CardAction(title="xyz link",type="openUrl",value="www.xyz.com",display_text="xyz",text="xyz"))]))

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Open Emulator'
  2. Click on 'Suggested Action with Link'

Expected behavior

After the user clicks the suggested action the display_text will be shown on the chat user response.

Screenshots

Example Suggested Options with OpenLink as CardAction.
image
After clicking any one of the above:
image
Nothing is displayed after clicking the button, like it will show selected option in the user side of the chat window.

Tracking Status

Dotnet SDK TODO

  • PR
  • Merged

Javascript SDK TODO

  • PR
  • Merged

Python SDK TODO

  • PR
  • Merged

Java SDK TODO

  • PR
  • Merged

Samples TODO

  • PR
  • Merged

Docs TODO

  • PR
  • Merged

Tools TODO

  • PR
  • Merged
@GreatHavoc GreatHavoc added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels May 1, 2024
@stevkan
Copy link
Contributor

stevkan commented Mar 28, 2025

@GreatHavoc - I don't know if you are still having an issue with this, but if you are, the reason this isn't working is because the openUrl card action does not post anything back to the bot (by design). To be clear, Bot Framework does not control the functionality of the openUrl card action.

To get around this you need to think outside the box a little bit. I would suggest:

  1. Have the suggested action setup to post a messageBack activity to the bot with an event value and text (to be displayed in the transcript window.
  2. Once the bot receives the event, have the bot send an event back to Web Chat with some arbitrary value
  3. Using Web Chat's store, monitor for the incoming event activity that contains the arbitrary value
  4. When the event is received, have the page open the URL using either a dispatched Web Chat store event or a page event.

You may be able to cut out steps 2 & 3 and simply monitor for the outgoing suggested action activity and dispatch an event from that. However, I haven't tested this. In any event, some variation of this will definitely work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

2 participants