- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2020 12:25 PM
I am configuring a client script and trying to get the value that is set in the field "source_table" which is Type: Table Name. I was looking for more information on the variable Type: Table Name, but nothing stood out to me. Can anyone help point me in the right direction so that my 'getValue' pulls the data? Thanks in advance!
function onLoad() {
var abc = g_form.getValue('source_table');
if (abc == 'change_request'){
g_form.removeOption(‘state’,‘information’);
}
}
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2020 12:11 PM
If you don't have that field on form then you will not be able to get value of it in client script.
Make sure source table field is on form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2020 11:57 AM
Hi Michelle,
Can you please include the script that you are running as well as a more complete screen print.
:{)
:{)
Helpful and Correct tags are appreciated and help others to find information faster
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2020 05:43 AM
Hi,
did you check what alert it gives for the value
function onLoad() {
var abc = g_form.getValue('source_table');
alert(abc);
if (abc == 'change_request'){
g_form.removeOption(‘state’,‘information’);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2020 11:46 AM
It doesn't seem to pull a value at all.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2020 12:00 PM
try adding toString()
function onLoad() {
var abc = g_form.getValue('source_table').toString();
if (abc == 'change_request'){
g_form.removeOption(‘state’,‘information’);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2020 12:11 PM
If you don't have that field on form then you will not be able to get value of it in client script.
Make sure source table field is on form.