We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

How to redirect using declarative actions

Nolan4
Tera Contributor

Create a new action assignment(sys_declarative_action_assignment). Now how to redirect to a link?
In the implemented as we have many options like server script, client script, etc.

 

This is link I want to redirect to - 

https://abc.service-now.com/now/nav/ui/classic/params/target/%24pmview.do%3Fsysparm_view%3Dfinancial...

Not working at all for me.  Please replace abc and abc-sys_id with something from your instance.

 

 



1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@Nolan4 

Make your Declarative Action Implemented as Client Script and use this syntax to open LINK

open(url);

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Hi, this works. Thank you.
I have one more button and I want the user to be re-directed to new cost plan view but inside the project workspace view itself. PFA images. 
When I am trying it is always redirecting to the image 1. But I want to redirect to image 2. 
Code I am using is as given below:

function onClick() {
 
    var projectSysId = g_form.getUniqueValue();
      
          var url = '/now/nav/ui/classic/params/target/cost_plan.do' +
        '?sys_id=-1' +
        '&sysparm_query=project=' + projectSysId +
        '&sysparm_view=default';
    open(url);
 
}






@Nolan4 Your query is correct but OOB , I did not find any column named "project" on cost plan table. Try below:

 

    var projectSysId = g_form.getUniqueValue();
      
          var url = '/now/nav/ui/classic/params/target/cost_plan.do?sys_id=-1&sysparm_view=default';
 
    open(url);
 
}