- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2020 10:45 AM
I am getting this error on the Chrome Console:
My script is:
function onChange(control, oldValue, newValue, isLoading) {
console.log('current.variables.mrvs_set_1: ' + g_form.getValue('mrvs_set_1'));
console.log('current.variables.mrvs_set_1_json: ' + JSON.parse(g_form.getValue('mrvs_set_1')));
}
Upon further checking, getValue returns a string and if you do a JSON.parse on this string, the error comes up. What am I missing? I want to use the MRVS data for a REST method that I will invoke for a 3rd-party system. Any thoughts?
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2020 11:35 AM
Your script seems correct.
Are you sure the mrvs_set_1 is the name of your variable?
Is there another variable or variable set with the same name?
Can you share the console.log messages?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2020 11:12 AM
Can you try
function onChange(control, oldValue, newValue, isLoading) {
console.log('current.variables.mrvs_set_1: ' + g_form.getValue('mrvs_set_1'));
console.log('current.variables.mrvs_set_1_json: ' + JSON.parse(JSON.stringify(g_form.getValue('mrvs_set_1'))));
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2020 11:35 AM
Your script seems correct.
Are you sure the mrvs_set_1 is the name of your variable?
Is there another variable or variable set with the same name?
Can you share the console.log messages?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2020 10:00 AM
Thank you. I have checked that and you are correct, it is different.