Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Pass variable values in URL

(1) ShareShare
ReportReport
Posted on by 7

I have a custom button on a dynamics 365 page which launches a customer voice survey.

I need the ability to pass the record guid into a variable so that once responded to, I can capture the initial record where the survey was launched from.

Thank you for any help with this.

  • SwertresResult Profile Picture
    2 on at
    Pass variable values in URL

    When passing variable values in a URL, you typically use query parameters. Query parameters are key-value pairs added to the end of a URL after a question mark (?). Each parameter is separated by an ampersand (&). Here's an example of how you can pass variable values in a URL:

     
    arduino
    https://example.com/page?variable1=value1&variable2=value2

    In this example, the URL https://example.com/page is followed by a question mark (?), and then the query parameters variable1=value1 and variable2=value2 are added. You can include as many query parameters as needed by separating them with ampersands.

    When constructing a URL with variable values, you should ensure that the values are properly encoded to avoid any issues with special characters or reserved characters. URL encoding replaces special characters with percent-encoded representations, making the URL safe to use.

    Here's an example of a URL with properly encoded variable values:

    https://example.com/page?name=John%20Doe&age=30

    In this case, the space in the name "John Doe" is replaced with %20, the percent-encoded representation for a space character.

    On the server side, when processing the URL, you can retrieve the variable values using the appropriate programming language or framework. The specific method will depend on the technology you're using. For example, in JavaScript, you can access the variable values using the URLSearchParams object or by parsing the URL manually.

    Remember to exercise caution when passing sensitive or private information in the URL, as URLs can be logged and stored in various places, potentially compromising the security of the data.

  • Suggested answer
    AN-22040756-0 Profile Picture
    7 on at
    RE: Pass variable values in URL

    Found the answer.

    The short URL that is copied from customer voice doesn't work.

    Instead use this URL

    https://forms.office.com/FormsPro/Pages/ResponsePage.aspx?id=

    followed by the ID of the form and then

    &ctx={"SessionID":"1234","recordtype":"opportunity"}

    replacing the variable names with your own.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans