Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alexander Wagner 36 posts 186 karma points
    Jun 03, 2024 @ 08:00
    Alexander Wagner
    0

    Umbraco Forms. [@Url] magic string, remove Querystrings

    Is it possible to remove query strings from the [@Url] magic string? I have a client that uses that in a hidden field in Umbraco forms so they know on which page the user has submitted the form but they've noticed that they get a lot of values where query strings from google are added (for example if the user have clicked on an add on google search).

    This causes trouble in their CRM (we send all form submissions to their CRM) since the url in question is to long for the CRM url field.

    It's easy enough for me to create a simple answer type that just populates a hidden field with current page url but I thought I would ask just in case :)

  • Kevin Meilander 82 posts 408 karma points c-trib
    Jun 06, 2024 @ 03:22
    Kevin Meilander
    0

    You can access other request values as magic strings as well, so I think [@Path] magic string would give you the page path without the query string.

    https://docs.umbraco.com/umbraco-forms/developer/magic-strings#request

  • Alexander Wagner 36 posts 186 karma points
    Jun 07, 2024 @ 05:25
    Alexander Wagner
    0

    Thanks for the suggestion but [@Path] didn't work (even though it's a part of HttpContext.Request).

    Oh well, I'll create a simple answer type for currentpage url :)

Please Sign in or register to post replies

Write your reply to:

Draft