Articles in this section

stripQuerystring helper

Removes everything after the ? in a URL, returning only the base path. Use it when you need a clean URL without query parameters.

Usage

{{stripQuerystring url}}
  • url (required): input string containing a URL

Examples

  1. Remove query parameters from a URL

    {{stripQuerystring record.fullUrl}}
    

    Input:

    {
      "record": {
        "fullUrl": "https://example.com/product?ref=ads&utm_source=google"
      }
    }
    

    Output:

    https://example.com/product
    
  2. Remove query and fragment

    {{stripQuerystring record.fullUrl}}

    Input:

    { "record": { "fullUrl": "https://site.com/page?x=1#section" } }

    Output:

    https://site.com/page

Tip

  • The helper only removes the querystring; the main path of the URL remains unchanged.

  • If a ? is present, everything from ? to end is removed (fragments after the query are dropped). If there’s no ? before the fragment, the URL is unchanged.

  • Works on plain strings and file paths (e.g., "/local/path/file.html?version=1.0" → "/local/path/file.html"). No URL validation or decoding is performed; the helper is simple string truncation at the first ?.