Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Declarative actions in UI Builder

Pallavi Gaikwad
Tera Expert

Hi All,

 

I want to implement a page navigation in workspace.

 

I have built a custom workspace. In that workspace have added 3 declarative actions i.e., New, create new user and create new business. These are implemented as UXF client action. Have grouped these actions in action group1.  Order for them are as 0, 1, 2 respectively. These actions are appearing in record list header. I want to configure navigation on clicking those actions. 

 

If I click on create new business action, then it should redirect to create record page in workspace. 
I Tried by adding event 'Declarative Action Client Script Button Clicked'. Also tried 'Declarative action redirect requested' event. However both are not working. 

 

Please let me know how can I implement this navigation. 

Thank you in advance for your support!

1 ACCEPTED SOLUTION

I tried that video in my PDI and it is working fine, please check the steps,

 

Create UI Action 

SarthakKashyap_0-1761115511869.png

Add code in workspace script

SarthakKashyap_1-1761115545578.png

Save it

 

Now navigate to All> Now Experience Framework> List Action

Create New and add same code in client script 

SarthakKashyap_2-1761115619160.png

 

Result

SarthakKashyap_3-1761115654473.png

SarthakKashyap_4-1761115668820.png

 

 

 

 

 

 

View solution in original post

11 REPLIES 11

Hi @Sarthak Kashyap 

Thank you for the solution.

SivaniG
Mega Guru

Hi @Pallavi Gaikwad 

 

Have you added the created event in UXF Client Action in Ui builder page events.

And called the event through event mapping in page??

Hi @SivaniG 

I didn't try that. Will try. Thank you for your reverting.

Ravi Gaurav
Giga Sage
Giga Sage

Hi @Pallavi Gaikwad 

Below link will help you :

https://www.servicenow.com/community/servicenow-ai-platform-blog/servicenow-agent-workspace-redirect...
or

Steps to make navigation work

Step 1 – Create UXF Client Action

  • Navigate to:
    Now Experience Framework > UXF Client Actions

  • Create a new Client Action for navigation (e.g. “Navigate to Create Business”)

  • Script example:

     
    api.triggerEvent('navigate_to_create_business', { targetPage: 'create-business' });

    This emits a custom event navigate_to_create_business.


Step 2 – Map Declarative Action to Client Action

  • Go to Now Experience Framework > Declarative Actions

  • Open your Declarative Action record (like “Create New Business”)

  • In the Action assignment, ensure:

    • Type = Client Action

    • Client action = the one you just created

  • Save.


Step 3 – Create an Event Mapping Record

  • Table: sys_ux_addon_event_mapping

  • Create new mapping:

    • Event Name: navigate_to_create_business

    • Add-on ID: (your Workspace or page add-on)

    • Payload key: targetPage (optional)

    • Mapped Event: The page-level event that actually performs navigation, such as Navigate To Page.

This tells ServiceNow:

“When the Declarative Action fires navigate_to_create_business, trigger the Navigate To Page event in UI Builder.”


Step 4 – Configure Page Event in UI Builder

  1. Open your Workspace page in UI Builder.

  2. Go to the Page Events section.

  3. Add a new Event Handler for the event you mapped (e.g. navigate_to_create_business).

  4. Action: Navigation → Navigate to Page

  5. Set the Destination page to your “Create Record” page (select it from dropdown).


Step 5 – Verify in runtime

  • Open your Workspace.

  • Click on Create New Business.

  • It should now redirect to your configured page.

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Hi @Ravi Gaurav 

Thank you for such detailed solution. Will try these steps.