
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2016 11:55 PM
Hi,
Is it possible to Gliderecord a catalog item variable value using setValue?
For example:
var variableName = 'test';
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item',current.document_id);
gr.query();
if(gr.next()){
gr.setValue(variableName, 'desired value');
gr.update();
}
Thanks,
Tadz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2019 01:18 AM
Hi Tadz,
You may try this:
var variableName = 'test';
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item',current.document_id);
gr.query();
if(gr.next()) {
//gr.setValue(variableName, 'desired value');
gr.variables[variableName] = 'desired value';
gr.update();
}
__________________
Warm regards,
Sean

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 12:28 AM
Is this part correct?
gr.addQuery('request_item',current.document_id);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 12:31 AM
Yes actually its working if I'm not using
var variableName = 'test';
gr.varaibles.variableName = 'desire value'; //not working
If i use:
gr.variables.<variablename> = 'desired value'; //working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 12:38 AM
gr.varaibles.variableName = 'desire value'; //not working
because spelling is wrong?
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 12:43 AM
sorry its a typo in my end. I just typed that.
even
var variableName = 'test';
gr.variables.variableName = 'desire value'; //not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2019 01:21 AM
Hi Kalai, i haven't revisited this. but yes this is the part that is wrong. there is no document_id in the sc_task table