The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to pass url as parameter in url

Hemu1
Giga Contributor

we are accessing catalog item from external, in this process we passing external site url as parameter. It's working fine when user is already logged in to ServiceNow, but it's giving page not found error when user not logged in after giving login credentials. During this external call the sysparm_url parameter value is showing as 'http://www.purple.com/", if We manually update sysparm_url value as www.purple.com it's working fine. we are not able to strip out 'http://' from this parameter value in external system.

We tried using this sysparm_url=encodeURIComponent('http://www.purple.com/'), still it's not working. So is there any other way to pass url as parameter?

Thanks ,

Dakshayani.

3 REPLIES 3

anurag92
Kilo Sage

you can use String functions for stripping out Http?


anurag92
Kilo Sage

Try something like this:


var url=http://www.purple.com;



url=url.split("//")[1];


url=String(url);


sysparm_url=encodeURIComponent(url);


Anurag Tripathi
Mega Patron
Mega Patron

If i understand corerctly,



this is how you should build your url



https://<instance name>.service-now.com/nav_to.do?uri=incident.do?sys_id=-1%26sysparm_query=priority=1^incident_state=3



sysparm_query follwoed by parameters


-Anurag