- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2017 01:24 AM
I have Table1 and table 2 :
I need to compare 2 different fields on 2 different tables and we have common id field on 2 tables like(reg id) and
(if img data !=sdpe data, copy the "img data"(section in table1) to "upd data"(another section in table1)
Note:img data is (table1 field), sdpe is (table2 field).
any one give the sample code for this req.
is this clear.if not please comment it.
Thanks in Advance.
Message was edited by: padhu1 padhu1
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2017 02:24 AM
Amlan pal,
Thanks for the quick reply.
how will pass the section name here? once
(if img data !=sdpe data,copy the "img data"(section in table1) to "upd data"(another section in table1).how to copy the data?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2017 10:01 PM
Hi Padhu,
Please use as below:
gr.new_field2_name = current.source_field_name;
You can use simply field1 if you have already defined any variable named that and stored the value of the source field value inside the variable. In my earlier example I have defined the variable named field1, you may have a look at that.
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2021 03:49 AM
I have similar requirement, but i dont have common field in two tables.
My requirement is custom table "cmdbtest" with field name "Name"
and cmdb_ci table with field name "Name"
I need to compare Name of cmdbtest and cmdb_ci table. whichever data do not match , I need to populate report for that unmatched data

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2017 02:09 AM
Hey padhu1,
You can GLIDE the record from the second table and compare with the first table record if it doesn't match then you can copy the data into first table.
Refer this for GLIDERECORD-
Using GlideRecord to Query Tables - ServiceNow Wiki