- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2025 03:56 AM
Hello, I am trying to load data on Control to Entity (sn_compliance_m2m_control_entity) using Transform Maps so that the Reliant entities get added to the Common controls. I am not sure how to achieve this. Can anyone help me on this??
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2025 07:51 AM
The first step was to prepare a file (CSV or Excel) with two main columns: one with the control number (for example, CTRL0001234) and another with the name of the entity (type Entity A).
After uploading the file to ServiceNow, it automatically generated an Import Set table. I then created a Transform Map, where I defined this table as the source and the sn_compliance_m2m_control_entity table as the destination.
In the Field Maps, I configured the logic so that the system would search for the control by number and fill in the field with the corresponding sys_id, and the same for the entity - I searched for the entity name and used its sys_id to fill it in correctly.
I also added a check to ensure that the same combination of control and entity wasn't created more than once, avoiding duplicates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2025 07:51 AM
The first step was to prepare a file (CSV or Excel) with two main columns: one with the control number (for example, CTRL0001234) and another with the name of the entity (type Entity A).
After uploading the file to ServiceNow, it automatically generated an Import Set table. I then created a Transform Map, where I defined this table as the source and the sn_compliance_m2m_control_entity table as the destination.
In the Field Maps, I configured the logic so that the system would search for the control by number and fill in the field with the corresponding sys_id, and the same for the entity - I searched for the entity name and used its sys_id to fill it in correctly.
I also added a check to ensure that the same combination of control and entity wasn't created more than once, avoiding duplicates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2025 02:29 AM - edited ‎04-14-2025 02:29 AM
Thank you for your reply @IsabelyA . Can you give me the code for check that ensures avoiding duplicates, that'd be very helpful. Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2025 05:46 PM
var exists = new GlideRecord('sn_compliance_m2m_control_entity');
exists.addQuery('control', target.control);
exists.addQuery('entity', target.entity);
exists.query();
if (exists.next()) {
return;
}