Category should be filled if a word is in the short description.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2025 04:01 AM
Category should be filled if a word is in the short description. how can i solve such problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2025 04:07 AM
Hi @harshchaudh
Please elaborate on your requirement, and also share what you've done so far and where you're currently stuck.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2025 04:12 AM
Hello @harshchaudh
As per my understanding, the code will be below that you are looking for.
Business rule:
Before Insert/Update
(function executeRule(current, previous /*null rule when insert*/) {
var shortDescription = current.short_description.toLowerCase();
if (shortDescription.includes("printer")) {
current.category = "Hardware";
} else if (shortDescription.includes("email")) {
current.category = "Software";
} else if (shortDescription.includes("network")) {
current.category = "Network";
} else if (shortDescription.includes("password") || shortDescription.includes("account")) {
current.category = "Access & Accounts";
} else {
// Set a default category or leave it blank if no match
// current.category = "General Inquiry";
}
})(current, previous);
Please let me know if it works.
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2025 06:30 AM
Hello @harshchaudh
Have you tried the above solution?
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2025 04:15 AM
Hi @harshchaudh Let’s think practically. What you are looking for is a good use of Predictive Intelligence. For example, if the short description contains 'LAN', the category should be 'Hardware'. But what if the short description contains 'CLAN' or 'DLAN'? Also, when using search help, it checks for any alphabet combination. So, I would say your Predictive Intelligence needs to account for these variations.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************