URL redirect link
# 🤝help
b
Hello I am new to botpress and I am looking for help finding a redirect to url, so when the user in my site bot chat selects the “Buy Now” option, after making that selection it automatically;lay launches to the embedded url. #1111009377525186570
b
you can't embed a URL directly within the choice options for capture cards like that
however you can just send them to a node that spits out a link when they select that option
so it would be: Buy now > click here!
a
If I understood you correctly, do you want that when someone selects the "buy now" option from your catch card, they will directly open the specified url? You can achieve this by redirecting it to a new node with an executive code, in which you will enter (Show this page "URL") in the code generation field.
b
Thank you both, @agreeable-cricket-15390 for some reason when I entered the data it worked when testing it I within the Botpress Studio, meaning it launched when the user opted for “Buy Now”, however didn’t work on the actual site 🤔
m
I have the same problem using the execute function as you showed @agreeable-cricket-15390 (although I first used a different code snippet). It works fine inside the emulator, but once using the published version via Botpress cloud or via embed on my own page it doesn't work anymore. It then displays the following error message each time: "Sorry, an error occurred. Please try again later" ----------- Don't know if I should open a separate help thread if we both have the same problem, but in any case to hopefully help solve the problem easier here is my Report ID: c54e79b1-6afe-40cc-9f93-4b668268ff02 (In case a separate thread is needed let me know) ----------- Ps @brief-musician-62925 I've temporarily "fixed" this by displaying the links via clickable text bubbles, as suggested and explained here. Might be a temporary solution for you as well. https://discord.com/channels/1108396290624213082/1138780007473369118/1138785313028841533
a
I honestly don't know anything about code. I just saw that this works and suggested it as a solution. According to some of my logic, everything that works in the emulator should also when it is published. I guess there is some problem with the application. Or maybe another line of code needs to be added to open the page relative to the platform it's being used on I hope someone from the botpress team will respond
b
@magnificent-salesmen-83576 thank you for that, I will give it a try, I settled doing the Buy Now, click here > url.com route
@agreeable-cricket-15390 thanks for your input, I’ve also experienced a delay in the response, or no response at all in chat in the live environment.
a
I think I read on the server that it only happens when using the free package of botpress, when you get the paid version of botpress it should work better if you are already using the paid version, then it is something else
l
@bumpy-butcher-41910 or anyone faced this issue??
f
You can't control the website from the bot
You could send an event to your website and then you can have some logic on your website to act on it
l
@fresh-fireman-491 thanks for replying, I just want my bot to redirect to this custom website url I provide when it selects an option from the multi-option selector, so how could I acheive this, any idea?
f
The first way that came to mind was sending an event like mentioned before, as I don't think you use links on choice cards.
206 Views