I have two Lightning Web Components. One is on Community Page #1, the other is on Community Page #2. The first LWC creates a record and then navigates to the second Community page. I need to send the recordId from the first page/first LWC to the second page/second LWC. I am using the Lightning Message Service but it is not working. (It works when both LWC's are on the same Community page).

Is this a limitation of the Lightning Message Service?

Are there any ideas to move forward with this?

If this is a limitation of the LMS, would Pub-Sub work better?

1 Answer 1


From what you describe, the two pages are rendered at a different point in time, not contemporaneously, so why would messaging work? The sender and receiver must both be active at the same time.

What you need to do is ensure that the navigation is done so as to include the record ID in the URL and ensure this is passed to the second LWC as a parameter.

Digital Experiences have access to query parameters directly by name, or path step bindings (that are prefixed by colon) without the colon and these are passed dynamically in parameters for components using brace-enclosed expressions of the form {!paramName}.

  • Hmm, I'm a little stuck on adding a parameter to the URL. I add the recordId parameter to the NavigationMixin as well as the component on page two.
    – aksnys
    Dec 6, 2021 at 18:33
  • Take a look at this Q&A in case it can help. Note that when I answered that the NavigationMixin did not support communities. Not sure of current state of play.
    – Phil W
    Dec 6, 2021 at 18:43
  • 1
    Thanks Phil for your help. I actually was able to use the "state: { recordId: this.recordId }" Inside the NavigationMixin. It was a little frustrating because of a typo... but it works now.
    – aksnys
    Dec 6, 2021 at 19:55
  • Feel free to upvote and mark this as best answer.
    – Phil W
    Dec 6, 2021 at 20:01
  • I've tried, but I don't have sufficient reputation
    – aksnys
    Dec 6, 2021 at 20:04

You must log in to answer this question.

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