Notifications
Announcements
Is there a way to get variables from the website where I publish the bot? That is, the client is already logged in on the website and suddenly starts using the bot, so as not to have to ask him for his name again, for example, since he is already logged in, is there a way to collect that data?
See if this helps: https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-variables-bot?tabs=webApp#set-a-global-variables-value-from-external-sources
BTW: if it's actually an authentication flow you are looking to implement, it is safer to pass a token, not details like name, etc.
Thanks for your reply. I have been testing and as I understand, in the call to the bot from the web I have to pass the parameter, for example, after the code I had, I put "&ClientID=5". Then in copilot I have to create the variable and put it with the same name as Global and that it can receive external data, but it asks me to assign a value, what should I put
Saludos y gracias
I guess it's not that clear in the docs - you need a question node in order to "capture" the incoming value:
But then if I ask it as a question, why do I send the variable through the url to the bot? What I supposedly want is that when the client opens the bot without asking anything, he directly sends a variable to the bot and with this variable, with internal processes, the bot responds one thing or another. For example, I don't want to ask the client again what his name is if he has already logged in to the website.
I have the same problem as you, ElenaAA. I've been researching for several days and I've looked at Microsoft's documentation twice. If at any time you manage to solve it, please share
The question node is just a way to capture an incoming value. When the conversation starts, the question will be skipped and won't be presented to the user.
The question is omitted, okay. But the client will have to write something to retrieve the variable, right? And at some point I will have to make that assignment of the Clientid variable of the url with the Global Clientid variable created, right?
I have also tried what you mentioned and it won't let me create a blank question.
For everyone on this thread, here is the complete solution:
1. Add a question node to your Conversation Start topic that will populate a global variable. Allow setting the variable from external sources.
kind: AdaptiveDialog beginDialog: kind: OnConversationStart id: main actions: - kind: Question id: question_ZOc4Os interruptionPolicy: allowInterruption: true variable: init:Global.myParam prompt: external variable entity: StringPrebuiltEntity - kind: SendActivity id: sendActivity_Yfykys activity: "Your value for myParam is: {Global.myParam}"
2. When embedding the copilot in your website, append a parameter with the same name as your global variable to the copilot URL.
For example:
https://web.powerva.microsoft.com/environments/env_id/bots/bot_id/webchat?__version__=2&myParam=myValue
When the conversation starts, the question will be skipped, and the variable will be populated from the URL parameter:
The question node itself will assign the value, and the user will not have to write anything - as the question is embedded in "Conversation Start". It's fine if the question isn't empty because it won't be shown. In short, try the solution I posted here, it works, I promise 🙂
Thank you very much, Adilei, I'm going to try it
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 261 Super User 2025 Season 2
Romain The Low-Code... 198 Super User 2025 Season 2
S-Venkadesh 93 Moderator