Need to remove 'nav_to.do?' from BR constructed URL?

Julie Peters
Kilo Explorer

I want to copy variables from a custom table (like new_call) to the catalog item chosen.  I am using logic from Brad Tilton to move over the custom table sys_id in URL constructed from the Business Rule. 

https://community.servicenow.com/community?id=community_blog&sys_id=596dea29dbd0dbc01dcaf3231f96190b

I added a sysparm value to the url"+" sysparm_newcall_sysid=" + current.sys_id;

The BR constructs the URL fine and I see it with a log statement. Unfortunately, the instance adds the default 'nav_to.do?' to the URL which causes the on load client script to get a null value for my parameter.  If I manually cut and paste the URL from the log (without the nav_to.do?) the client script gets the value successfully. 

Is there a way to remove part of the default URL path, specifically the nav_to.do? 

The onload client script need to work for a Service Portal catalog item, so no document or window commands please.  Thank you!

 

 

9 REPLIES 9

Seems like the client script ought to work regardless, since it finds the system parameter without the URL change.  As a different solution, can the client script be altered to find the new call value using replace functions?

 

Probably, but you really should be able to grab it with the full frameset url. Could you paste in an example of the full url?

https://dev.myinstance.servicenow.com/nav_to.do?uri=%2Fcom.glideapp.servicecatalog_cat_item_view.do%3Fsysparm)id%3Dlotsofletters%26sysparm_newcallsysid%3Dsysid

Above does not work.

https:/dev.myinstance.servicenow.com/com.glideapp.servicecatalog_cat_item_view.do%3Fsysparm)id%3Dlotsofletters%26sysparm_newcallsysid%3Dsysid

Works (gives the sysparm value in "results" alert for client script and writes successfully to the field.

 

 

 

 

If you just paste in this link does it work (replacing the sys_ids of course):

https://dev.myinstance.servicenow.com/nav_to.do?uri=com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=lotsofletters&sysparm_newcallsysid=sysid

No sorry, it still returns the null values for the newcallsysid, and actually just adds the '%2F" right back into the url.

Sorry I cant cut and paste directly from the instance, it is behind a firewall.

So how about the "new window" approach?  Thanks for your patience with this.