How to access the record producer variable

ramesh_r
Mega Sage

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);

}

1 ACCEPTED SOLUTION

Can you check if there is an entry in question_answer table once for the submitted record with required values.

View solution in original post

13 REPLIES 13

What are you getting from the script, can you give more details?

This is my record producer

find_real_file.png

 

 

find_real_file.png

 

after i submitted the above record producer its creating record properly and i am trying to get the value using below script

 

var gr = new GlideRecord('remediation_rule');
gr.addQuery('sys_id', 'ae4d693a2fdf011009d159ab2799b693');
gr.query();
if(gr.next()){
var name = gr.variables.test;

gs.info(name);

}

Getting below output but i need value what i entered in the from

find_real_file.png

Can you check if there is an entry in question_answer table once for the submitted record with required values.

Yes, i can able to see the values in the "question_answer" tables.

 

Thanks

Hi,

scope issue?

record producer is in which scope?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader