Expertise Folks kindly help !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2024 02:00 PM
Hi everyone, I'm currently self-learning ServiceNow and exploring its features.
I've successfully created a task where, upon selecting an Employee Department and Employee Designation, the Hotel Type auto-populates. This part is working as expected (screenshot with options attached).
Based on this, I created a second task around cricket, with fields for the top 5 countries, player grade, and player auction. My goal is to have the 'player auction' field auto-populate based on the selected country and player grade.
Is this feasible? I've been trying for a while without success and would appreciate any guidance. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 07:34 AM
I suggest you post what you've tried, so folks here can assist. My guess is you may be using a Client Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 08:08 AM
Hi @Raj_7apr ,
You can create on change client script on both filed (country and player grade) with same script like below.
var country = g_form.getValue('u_country); // put your country field name.
var grade = g_form.getValue('u_grade); // put your greade field name.
If(!(grade =='' || country =='')){
If(grade =='xyz' && country =='abc'))
g_form.setValue('u_auction', 'Put your value');
else If(greade =='xyz1' && country =='abc2'))
g_form.setValue('u_auction', 'Put your value2');
// and so you can add. If condition have more than 3 case then you can use switch case instead of if else
}else{
g_form.clearValue('u_auction');
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------