- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 11:08 PM
Hi All,
I have created the record producer and i selected the target table as "remediation_rule" and once I submitted the record procedure the record is getting created in the "remediation_rule" table. and i am trying to get the variable value using the below script but it's not working as expected
Variable will access only Incident change table like that ..? becase the same log working in those table
var gr = new GlideRecord('remediation_rule');
gr.addQuery('sys_id', 'ae4d693a2fdf011009d159ab2799b693');
gr.query();
if(gr.next()){
var name = gr.variables.test;
gs.info(name);
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2022 12:35 AM
Can you check if there is an entry in question_answer table once for the submitted record with required values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2022 12:21 AM
Hi,
where are you writing the above script?
the syntax is fine
Are you checking correct variable name? what is the variable type?
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
‎05-10-2022 12:22 AM
Above should work.
Are you sure
gr.addQuery('sys_id', 'ae4d693a2fdf011009d159ab2799b693');
value being passed as sys_id value is correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2022 05:40 AM
Record Producer is used to create task based records from service catalog. If you want to access record producer variables then table should be extending from 'task' table . remediation_rule is not extending task table that's why your script is not working as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2022 05:48 PM
Did you get the answer Ramesh? I am also facing same issue. If you can let me know, will be helpful.