- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:28 AM
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.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:59 AM
Hi
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
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:33 AM
can you add the log before the line number 18.
check the row count
gs.log('Row Count is '+ gr_req.getRowCount())
Note: if you are on scoped app use gs.info()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 08:04 AM
Thanks Harshvardhan, Yes I changed the encodedquery to addQuery and then it returned rowCount as 1. Now it worked by also adding 'variables' while fetching the value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 08:15 AM
glad it has solved.
Kindly mark @muhammad solution as correct because he caught the exact issue. i just guided you to add logs so you can do some further troubleshoot, you can mark other user solution as helpful here, everyone has contributed well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:35 AM
Just run the code 11 to 22 in the fix script & put some logs to check whether you are able to fetch the record.
Also target.field name should be the table field name rather then what I am looking it seems the column of source.Check this oiut as well.
Thanks
Sudhanshu