Script Transform Map
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 11:46 AM - edited ‎07-22-2023 11:07 AM
Hello everyone
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 12:41 PM
Hi @yoli1 ,
Hope you are doing great.
Here's a user-friendly, professional solution for the ServiceNow query:
- navigate to the "Import Sets" module in ServiceNow.
- Select the appropriate Import Set Table that corresponds to your source table.
- Click on "Field Maps" to configure the field mapping between the source and target tables.
let's add a script to the field mapping to perform the required transformation:
(function transformMap(source, target, map, log, isUpdate) {
// Get the value from the source field
var sourceValue = source.email.toString();
// Replace '-' with '@' in the source value
var transformedValue = sourceValue.replace(/-/g, '@');
// Set the transformed value to the target field
target.email = transformedValue;
})(source, target, map, log, action === 'update');
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma
Regards,
Riya Verma
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 01:44 PM - edited ‎07-21-2023 02:30 PM
@Riya Verma Thank you