How to access a variable inside a variable set using Client script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2020 04:53 AM
I am trying to access a variable of a variable set using an On_change client script but not sure about the steps.
Var set name : on_behalf_of
Var name : caller_id - which refers to a table user_info
Tried using - var clrID = g_form.getValue('variables.caller_id'); but I could see an empty alert box when I try to print clrID . Attached the same for reference. Any idea would be useful.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2020 10:12 PM
Hi,
you should directly use the variable name;
var clrID = g_form.getValue('caller_id');
alert(clrID);
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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-21-2020 01:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2023 04:50 AM
Hi,
I can use the code mentioned in conjunction of a variable & catalog item.
The behavior does not seem to be present when interacting with a multi-row variable set.
I am trying to create a MRVS that lets a user select from their own assets only.
Any ideas?
-Lon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 12:09 AM
Dear Ankur,
I am trying to use clear value on two variables in variable set, one is a select box and one is date time. And these API's (g_form.clearValue('select_Box')) is not working on these two types of variables when these variables are in a variable set. It works when it is present in catalogue item but not when used inside a variable set. Reference type variable is working fine while inside a variable set. Can you please help me with it.