By selecting the Opened for I want to Auto populate Contact number by using the Sciptinclude

kranthi2
Tera Expert

Hi,

i have used the below script with contact number modifications but it is not working as expected. hence contact number is not populating

please find the below mentioned Screenshots for the same.

 

onChange.pngScript.png

 

variable.png

 

Please help me out if i can do any modifications in the script.

Thanks,

18 REPLIES 18

@kranthi2 ,

 

please replace 14th line with this

alert("Response :-"+ contact_num);

 

Thanks,

Danish

 

@kranthi2 ,

 

Please add those 2 lines added by @Voona Rohila in ur script include after line 18. That is the most probable cause.

 

Thanks,

Danish

 

@kranthi2 please put alert before the if statement as below,

alert("Contact in CS "+contact_num);

Also add logs in your script include before return statement.

gs.log("Contact from SI " +conatct_num, 'contact');

Voona Rohila
Kilo Patron
Kilo Patron

Hi @kranthi2 

You can simply use Auto Populate Feature, You can  achieve your requirement with No Code.

Refer Below Link:

https://www.servicenow.com/community/developer-articles/auto-populate-a-variable-based-on-a-referenc...

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Yes i have already tried but when ever user is logged as a end user then contact number is not populating hence i have use the scriptinclude 

please help me out the issue in the script please.