---
schema_version: "1"
id: ba79192e7fd7a789816f2b7c269870064ba80516e803b1cd5690501b47ec0ee1
title: Add Query Parameters
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/components/components-navigate-add-params.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/components-navigate-add-params.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ad2d0de22b031007919a67a3ac8148bd60bcafbfd9b429cbd74c0b306bf457f4
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# Add Query Parameters

To add query parameters to the URL, update the PageReference `state` property. The key-value pairs of the `state` property are serialized to URL query parameters. The query parameters describe the page and form a more specific URL that the user can save or bookmark.

Keep these behaviors in mind when working with the `state` property.

-   You can’t directly change the `pageReference` object. To update the `state`, create a new `pageReference` object, and copy the values using `Object.assign({}, pageReference)`.
-   `state` parameters must be namespaced. For example, a managed package with the namespace `abc` with a parameter `accountId` is represented as `abc__accountId`. The namespace for custom components is `c__`.Parameters without a namespace are reserved for Salesforce use. This namespace restriction is introduced under a critical update in Winter ’19 and enforced in Summer ’19.
-   Since the key-value pairs of `PageReference.state` are serialized to URL query parameters, all the values must be strings.
-   Code that consumes values from `state` must parse the value into its proper format.
-   To delete a value from the `state` object, define it as `undefined`.

If your component uses the `lightning:hasPageReference` or `lightning:isUrlAddressable` interfaces, always implement a change handler. When the target of a navigation action maps to the same component, the routing container might simply update the `pageReference` attribute value instead of recreating the component. In this scenario, a change handler ensures that your component reacts correctly.

