I see some strange behavior with lightning:isUrlAddressable tab. When I try to enter the parameter after loading the page immediately parameter is removed from the URL and component is not able to find the param value.

Simple Cmp:

<aura:component  implements="lightning:isUrlAddressable,force:appHostable" access="global">
    <aura:attribute name="urlParam" type="string"/>
    <div class="slds-card">
        If you implements "lightning:isUrlAddressable" interface, then by 
        using v.pageReference,you can get URL params.
        <div class="slds-box">  
            Account name from URL parameter: <b>{!v.pageReference.state.accname}</b>

Screenshots: enter image description here

param is disappeared after pressing the ENTER button

enter image description here

  • This works quite fine for me, try in some other browser?
    – Raul
    Commented Feb 25, 2019 at 16:07
  • Could be a Lightning Component Tab issue. Try addressing the component itself (as per this documentation), which will look something like: /lightning/cmp/c__myTestCmp?accname=Ajay. Also see this post for a full example Commented Feb 25, 2019 at 18:08
  • I tried in firefox browser too, it is same behavior.
    – Ajay
    Commented Feb 25, 2019 at 18:26
  • @BrianMiller: Yes I tried your approach too, same behaviour, immediately after page load params are disappeared.
    – Ajay
    Commented Feb 25, 2019 at 18:27
  • xxxxx--staging2.lightning.force.com/lightning/cmp/…
    – Ajay
    Commented Feb 25, 2019 at 18:28

2 Answers 2


Here I found it in the document that we should add default namespace C__ to the parameters.


This worked for me.

  • You add namespace to component names, not params. Correct url should be lightning/n/c__Test_Cmp?accname=ajay
    – dzh
    Commented Mar 1, 2019 at 3:26
  • it doesn't work, I already tried, it says Enter a valid URL and try again. something has changes in Spring19.
    – Ajay
    Commented Mar 1, 2019 at 16:12
  • 1
    Specifically this reference: releasenotes.docs.salesforce.com/en-us/spring19/release-notes/… Commented Jun 5, 2019 at 12:16

Well this is some fun stuff. Although the documentation says you have to add "c__" to component name, I had the same issue when I didn't add "c__" to the param names.

For example:


Was loading the page without any parameter in the state variable. See below the console.log of the pageReference:


And the parameters after the "?" were not there anymore after load:


So I tried with both


And that Worked.


If anyone has an idea why it only works like that for me and seems to work another way for others i'd be curious to know.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .