Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Using Glide Query in transform map script to retrieve values and update in target record

Geeta5
Giga Contributor

I have requirement where in transform map script(here Source table: staging table and target table : cmdb_ci) I have to check certain values(application_owner, application name)  from sc_req_item table based on a match of 'alert id' and get values from sc_req_item table and update in target table(cmdb_ci).

I have written below code in Transform map script but I am not able to fetch values from sc_req_item table.The if loop (line  19) is getting executed i.e condition evaluates true, but I am not able to get value of 'Application_owner' , 'application_name'(line 20,21 not returning value). Please suggest how to achieve this.

find_real_file.png

 

1 ACCEPTED SOLUTION

MrMuhammad
Giga Sage

Hi @Geeta

if application_owner and application_name are variables on sc_req_item table then update below lines as.

application_owner = gr_req.variables.application_owner;

application_name= gr_req.variables.application_name;

 

Thanks & Regards,

Sharjeel

Regards,
Muhammad

View solution in original post

14 REPLIES 14

Try with logs.

gs.log(gr_req.variable_pool.application_owner);

gs.log(gr_req.variable_pool.application_name);

 

if(gr_req.next()){

application_owner = gr_req.variable_pool.application_owner;

application_name= gr_req.variable_pool.application_name;

}

target.application_owner= application_owner;

target.u_application_name = application_name;

 

The world works with ServiceNow

MrMuhammad
Giga Sage

Hi @Geeta

if application_owner and application_name are variables on sc_req_item table then update below lines as.

application_owner = gr_req.variables.application_owner;

application_name= gr_req.variables.application_name;

 

Thanks & Regards,

Sharjeel

Regards,
Muhammad

Thanks Muhammad, it worked.

Happy to help. Have a great weekend 🙂

Regards,
Muhammad

Please select appropriate response as correct as it is reference for others with the similar problem in the future. 

Regards,
Muhammad