How to map data between two tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2024 08:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2024 08:48 PM
Could you please provide more information? That would be very helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2024 08:54 PM
I have a requirement where I want to map two tables. when I create data in one table 1. Automatically the same data should be carried as a record in table 2. How can this be achieved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2024 08:59 PM
I have a requirement where I want to map data between two tables. When I create data in table A, the same data should automatically be copied to table B ,creating a new record in table B also.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2024 06:00 AM
In this case you need to create an after insert business rule on table A. This business rule will create a record in table B. You can use following script in the business rule.
(function executeRule(current, previous /*null when async*/) {
// Create a new GlideRecord for Table B
var newRecord = new GlideRecord('table_b'); // Replace 'table_b' with the actual name of Table B.
newRecord.initialize();
// Copy fields from Table A to Table B
newRecord.field1 = current.field1; // Replace 'field1' with the actual field names.
newRecord.field2 = current.field2; // Add more fields as needed.
// Insert the new record in Table B
newRecord.insert();
})(current, previous);
Update the table and field name in the above business rule and use it to create record in table B.
Hope this helps.