Skip to main content

Notifications

Community site session details

Community site session details

Session Id : bKh//suo+diSMzikZ7Arru
Copilot Studio - Calling Actions from Copilot S...
Unanswered

How to get referer/URL from copilot

Like (0) ShareShare
ReportReport
Posted on 8 Mar 2024 13:54:36 by 12

Hello,

 

We are trying to retrieve the url or referer from which the copilot is executed.

For the moment we haven't found a solution, either using power automate or native functions.

 

Do any of you have an idea of how to retrieve the url of the chatbot execution?

 

Thanks a lot

Categories:
  • BenoitG Profile Picture
    12 on 12 Mar 2024 at 21:43:43
    Re: How to get referer/URL from copilot

    No, if I open on browser that URL :
    https://copilotstudio.microsoft.com/environments/Default-xxxxx/bots/xx/webchat?__version__=2&firstname=john&name=woo

    I'll get firstname & name

    if I change or refresh with https://copilotstudio.microsoft.com/environments/Default-xxxxx/bots/xx/webchat?__version__=2&firstname=betty&name=boop

    I'll get "john woo" displayed and not "betty boop" I want.

    We tried to play with "clear all variables" without success, like cache on bot side.

  • adilei Profile Picture
    on 12 Mar 2024 at 21:31:08
    Re: How to get referer/URL from copilot

    The value stays the same in your JavaScript? Or does it change and only the global variable stays the same?

  • BenoitG Profile Picture
    12 on 12 Mar 2024 at 21:25:04
    Re: How to get referer/URL from copilot

    right !

    it looks cache problem (on copilot ?.. or config), first time we get it, then the query string is always "old" value and overwrite with first value entered.
    I mean everytime we refresh browser (or private window), value is always the same..

  • adilei Profile Picture
    on 12 Mar 2024 at 21:17:28
    Re: How to get referer/URL from copilot

    Did you check - "External sources can set values"?

     

    https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-variables-bot?tabs=webApp#set-a-global-variables-value-from-external-sources

     

     

     

  • BenoitG Profile Picture
    12 on 12 Mar 2024 at 20:21:51
    Re: How to get referer/URL from copilot

    Hi Adilei,

    We tried like that with using Global, but it looks not work. We tested with endpoint, custom canvas and copilot embedded with query string (ex : &url=beta)

    But to get that query string from a topic for example, copilot ask a Global var with a predefine value; We cannot create a variable without default value, and that one looks always overwrite query string..

     

    Online documentation you provided indicate how to send query string, but not how to use it as global. Do you have any idea about that ?
    We only found that https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-variables-bot?tabs=webApp not indicating how to manipulate query string.

     

    Kind regards

  • adilei Profile Picture
    on 08 Mar 2024 at 17:47:06
    Re: How to get referer/URL from copilot

    You mean the URL for the page in which the copilot is embedded? You can pass that as a parameter: https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-variables-bot?tabs=webApp#set-global-variables-in-an-embedded-bot 

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.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Copilot Studio - Calling Actions from Copilot Studio

#1
Ekta Gupta Profile Picture

Ekta Gupta 4

#2
stampcoin Profile Picture

stampcoin 2

Overall leaderboard

Featured topics