- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 08:01 AM
Hi everyone,
I want to autofill fields for a Library Card Catalog Item in my PDI when a student is selected in Student Name field.
Following fields are to be auto populated: Email and mobile number. How to achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 01:10 AM
Hi Ehab,
you can create a catalog client script(Onchange) for the variable set containing above variables. the below script will definitely help you fulfill your task.
function onChange(control, oldValue, newValue, isLoading)
{
if (isLoading || newValue == '')
{
return; }
var student_ref = g_form.getReference('student_name');//get sys_id of entered student
alert(student_ref);//alert for the confirmation
g_form.setValue('mobile_phone',student_ref.mobile_phone);//set the values on catalog variables from the obtained object
g_form.setValue('email',student_ref.email);
}
hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 11:22 AM
You can use Auto Populate on variable.
Share screen shot for more details.
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]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 01:10 AM
Hi Ehab,
you can create a catalog client script(Onchange) for the variable set containing above variables. the below script will definitely help you fulfill your task.
function onChange(control, oldValue, newValue, isLoading)
{
if (isLoading || newValue == '')
{
return; }
var student_ref = g_form.getReference('student_name');//get sys_id of entered student
alert(student_ref);//alert for the confirmation
g_form.setValue('mobile_phone',student_ref.mobile_phone);//set the values on catalog variables from the obtained object
g_form.setValue('email',student_ref.email);
}
hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 01:24 AM
please watch the following small video so learn how to manage this without any coding: https://www.youtube.com/watch?v=IMLdnF7ufOg
Maik