How to pass url as parameter in url
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 02:57 AM
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.
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 03:01 AM
you can use String functions for stripping out Http?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 03:08 AM
Try something like this:
var url=http://www.purple.com;
url=url.split("//")[1];
url=String(url);
sysparm_url=encodeURIComponent(url);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 03:30 AM
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