- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 05:27 PM - edited 02-08-2025 05:28 PM
your importing list of record and you want that whenever I am importing a data and I want to make sure that whatever data is getting inserted into database each and every letter of the that first alphabet should be capital so how will you do that.
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2025 09:52 PM
Hi ,
To ensure that the first letter of each word is capitalized while importing data into ServiceNow, you can use a Field Transform Script in the Transform Map of your Import Set.
Solution: Field Transform Script in Transform Map
- Go to System Import Sets → Transform Maps.
- Open the relevant Transform Map.
- Find the target field where you want to apply this transformation (e.g., name, description).
- In the Field Transform Script, add the following script:
(function transformEntry(source, target, map, log) {
function capitalizeWords(str) {
return str.replace(/\b\w/g, function(char) {
return char.toUpperCase();
});
}
target.name = capitalizeWords(source.name); // Modify 'name' field
})();
Explanation
- The capitalizeWords(str) function ensures that every word in the string starts with an uppercase letter.
- The Transform Script applies this function to the target field (name in this case) before inserting the data into the database.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 10:27 PM
Hi @kusumgautam
Goal:
When importing data into ServiceNow, we want to automatically capitalize the first letter of each word in a specific field (e.g., Name, Description).
How to Do It?
We’ll use a Field Transform Script in the Transform Map of the Import Set.
Steps to Implement:
- Go to
System Import Sets
→Transform Maps
- Open the relevant Transform Map
- Find the Target Field (e.g.,
name
) - Add the following script under the Field Transform Script section
var text = source.name; // Get the source value
var words = text.split(" "); // Split into words
for (var i = 0; i < words.length; i++) {
words[i] = words[i].charAt(0).toUpperCase() + words[i].slice(1); // Capitalize first letter
}
target.name = words.join(" "); // Join words back into a single string
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2025 09:52 PM
Hi ,
To ensure that the first letter of each word is capitalized while importing data into ServiceNow, you can use a Field Transform Script in the Transform Map of your Import Set.
Solution: Field Transform Script in Transform Map
- Go to System Import Sets → Transform Maps.
- Open the relevant Transform Map.
- Find the target field where you want to apply this transformation (e.g., name, description).
- In the Field Transform Script, add the following script:
(function transformEntry(source, target, map, log) {
function capitalizeWords(str) {
return str.replace(/\b\w/g, function(char) {
return char.toUpperCase();
});
}
target.name = capitalizeWords(source.name); // Modify 'name' field
})();
Explanation
- The capitalizeWords(str) function ensures that every word in the string starts with an uppercase letter.
- The Transform Script applies this function to the target field (name in this case) before inserting the data into the database.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 10:27 PM
Hi @kusumgautam
Goal:
When importing data into ServiceNow, we want to automatically capitalize the first letter of each word in a specific field (e.g., Name, Description).
How to Do It?
We’ll use a Field Transform Script in the Transform Map of the Import Set.
Steps to Implement:
- Go to
System Import Sets
→Transform Maps
- Open the relevant Transform Map
- Find the Target Field (e.g.,
name
) - Add the following script under the Field Transform Script section
var text = source.name; // Get the source value
var words = text.split(" "); // Split into words
for (var i = 0; i < words.length; i++) {
words[i] = words[i].charAt(0).toUpperCase() + words[i].slice(1); // Capitalize first letter
}
target.name = words.join(" "); // Join words back into a single string
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/