- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 04:10 AM
Hi Team,
We have two table custom table Job family and Approval table
Job Family
Job Family |
IT |
HR |
Sales |
Approver Table
Job Family | User |
IT | Abel Tuter |
Sales | Beth Anglin |
i want script which will compare two table and print HR data from Job family table.
Regards,
Kaka Nayeem
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 04:16 AM
Try this.
var jf= new GlideRecord('<job Family Table>');
jf.query()
while(jf.next()){
var gr2 = new GlideRecord('<approval family table>');
gr2.addQuery('<job family field on approval table>', jf.name);
gr2.query();
if(gr2.getRowCount() = 0}
gs.addInfoMessage('found item: ' + gr2.<job family field on approval table>);
}
}
Add correct table and field names
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 04:11 AM
What is the volume of data in each table? how big can they get?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 04:12 AM
its Around 50-75
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 04:16 AM
Try this.
var jf= new GlideRecord('<job Family Table>');
jf.query()
while(jf.next()){
var gr2 = new GlideRecord('<approval family table>');
gr2.addQuery('<job family field on approval table>', jf.name);
gr2.query();
if(gr2.getRowCount() = 0}
gs.addInfoMessage('found item: ' + gr2.<job family field on approval table>);
}
}
Add correct table and field names