- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2014 03:35 AM
Hi, Im trying to get my form link UI Action to open a URL, where the end of the URL name changes dependant on whats in a field on the form.
I can get it open, but, unfortunately Im struggling with the passing the number to the end of it.
The field on the form is called u_project_no. Its a string.
Heres what I have so far:
function showGoogleSite() {
var url = new GlideURL('https://sites.google.com/a/rentokil-initialsites.com/' +'current.u_project_no');
var w = getTopWindow();
var newWindow = w.open(url.getURL(), "_blank");
newWindow.focus();
return false;
}
Im not hot on Javascript, but Im trying! Can anyone help please?
Thank you in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2014 06:43 AM
Hi Pennie,
Please try the below script and let me know the outcome.
function showGoogleSite() {
var Projno = g_form.getValue('u_project_no');//Gets the current project no
alert(Projno) //Just for testing purpose to see if the value is passed
var url = new GlideURL('https://sites.google.com/a/rentokil-initialsites.com/'+Projno);
var w = getTopWindow();
var newWindow = w.open(url.getURL(), "_blank");
newWindow.focus();
return false;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2016 02:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2016 03:40 PM
All,
I went ahead and updated the discussion to reflect correct answer.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 10:07 AM
Hi Pradeep,
How to get the url from a sys_property and utilize the same in UI action?
var url = new GlideURL('https://sites.google.com/a/rentokil-initialsites.com/'+Projno); --> I don't want to hardcode my url here
Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 11:42 AM
Hello Karthik,
You can fetch the value of property at server side as
Syntax : gs.getProperty('YOUR PROPERTY NAME HERE');
Reference:
http://wiki.servicenow.com/index.php?title=GlideSystem#getProperty.28String.2C_Object.29&gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2016 08:36 PM
Thanks Pradeep, i couldn't use in client callable UI Action. Used glide ajax to get the property value and then used in UI Action