Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Pass variable values in URL

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
    SwertresResult 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
    AN-22040756-0 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans