
- 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:08 AM
Yes... it is possible. Is you code not working?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 12:13 AM
yeah its not working.
i also tried.
var variableName = 'test';
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item',current.document_id);
gr.query();
if(gr.next()){
gr.variables.variableName = 'desired_value';
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2016 12:19 AM
Give gs.log(gr.getRowCount()) ; after gr.query(); to check if you are able to get the record..
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:18 AM
I didn't understand completely but do you mean you want to set a variable using GlideRecord ? Check if below link helps.
Glide Record Query in Workflow
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.