- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2025 08:36 PM
I am using a script include to pull data onto a record producer, the scrip include is supposed to populate data into the Service Portal form if the users have a previous record, but I keep getting a null value in my alert message. I am using an onLoad client script to populate the record producer. It works under my account but it doesn't work if I impersonate or if I sign in as another user.
I've done this many times on the backend but not really on the front end, I feel as if it shouldn't be that different.
Script Include:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2025 09:01 PM
Hi @Maxwell3 ,
If it is working for you and not working while you impersonate then check for ACL role which is assigned while submitting the Script Include.
System Security -> Access Control (ACL)
ACL type: Client Callable Script Include
Name is your script include
Then look for role if it is admin then your script include will execute for users having admin hence change the role and assign a generic role which all the users will have. Like ITIL etc.
If my response helped, please hit the Thumb Icon and accept the solution so that it benefits future readers.
Regards,
Rohit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2025 09:23 PM
client callable GlideAjax have ACLs to it.
Did you check if the user satisfies that ACL? Is that user with snc_external role?
is it calling script include? try adding gs.info()
any query business rule is running on that table and blocking? try to use setWorkflow(false)
var Utils = Class.create();
Utils.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getRecords: function() {
var obj = {};
var userID = this.getParameter('sysparm_userid');
gs.info('userID' + userID);
var gr = new GlideRecord('table');
gr.addQuery('opened_for', userID);
gr.setWorkflow(false);
gr.query();
if (gr.next()) {
obj.u_eligibility = gr.getValue('u_eligibility');
obj.u_application = gr.getDisplayValue('u_application');
obj.u_status = gr.getValue('u_status');
}
return JSON.stringify(obj);
},
type: 'Utils'
});
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2025 10:48 PM
Hello @Maxwell3 ,
To have the Script Include executed by Non-Admin user and accessible on Portal as well, create an ACL of type " client_callable_script_inclue" and added a role "snc_external". Reference snippet below.
If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.