Script include and client script is not working, however same is working in bg script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 04:08 AM
Below are the script include to find the model name already exists in the cmdb_hardware_product_model table. However I am unable to get the result value in the client script. Script is working in Background scripts.
Any suggestions?
This is the Script Include I have used but the result I am unable to get. However background script is giving correct result
This is the client script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 08:05 AM
HI @Mounika5 ,
i could see get attribute state line number 7 this not required when you getXMLAnswer
just use alert(result) in line 17
I would also verify below :
1)Verify Script include is client callable
2)I would log and see paramter sent from Client side in script include
3)Log and print the output
4)if its not working , i would return some static value from script include like return "Mounika" to verify client - script include communication is good.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 08:45 AM
Hi @Mounika5 ,
- Change line number 15 to ga.getXML(response);
- Line no 17 to var result1 = response.responseXML.documentElement.getAttribute("answer");
Then try your code.
Thanks,
Danish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2023 10:12 AM - edited 11-23-2023 10:18 AM
@Mounika5 Since you are already using getXMLAnswer, no need to result.responseXML.documentElement.getAttribute. Replace line number 17 in your client script with the following.
var result1 = result;
Hope this helps.