How to Send Event from Page Collection to Parent Page in UI Builder?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2025 07:11 PM
Hi,
I'm trying to send a custom event from a Page Collection page to its Parent Page in UI Builder.
When using a Subpage, I was able to successfully emit and handle the event in the parent using the SEND MESSAGE event in the Variant Event Mappings. However, when using a Page Collection, I’m not seeing the same behavior.
Specifically, in the SEND MESSAGE Relay (Default) section of the Variant event mappings, I'm trying to add a SEND MESSAGE event — but this event isn't available for the Page Collection.
I followed the steps from this post:
…but haven’t been successful in getting the event to bubble up from the Page Collection to the parent page.
Does anyone have the proper steps or workaround for sending custom events from a Page Collection to the parent?
adding image from subpage and page-collection body event.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 06:27 AM
@Brad Tilton Thanks for the response. Is there any documentation or reference implementation PC to send event to parent page? I am stuck on this for a week. looking for some help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2025 06:05 AM
You're not actually passing an event to the parent page, but you're able to call an event handler on the parent page's controller. When you go to add an event handler to an event on your page collection page you should see all of the event handlers associated with the parent page's controller available. That's how the PC page communicates with the parent page.
You can see an example of that from a knowledge lab we did last year: https://servicenownextexperience.github.io/labs/CCL1200-K24-Adv-Workspaces/ex2/overview
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
I would think ServiceNow would define this difference between page collections vs viewport subpages to be a critical in determine which to use. For example, I am using a variant of the standard record page (from CSM default record page) and noticed it already has a "CSM record page modals" page collection behind the Modal Container (Viewport), so I used it. After building the entire page within the collection, I realized I needed to have my modal page emit an event to tell the parent to do something (in my case, update a client state param to force the "Attachments" side panel component to reload), but that's when I ran into the issue described in this thread. I guess now I need to backtrack and create a new Modal viewport on my parent page so that my modal is a "true" subpage of the parent so it has access to the parent page's events, not just the controller's events.
