How to auto populate user fields from scoped Application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2023 07:13 AM
Hi All,
I have created an Application.I have a field called Submitter Name from User table.Based on the submitter name, I need to autopopulate other fields (location,department,employment status and email) from the user table.I have included my script include and client script.When I try to select submitter name I am getting Error message-Access to script include blocked from application scope".I need your help to sought this out.
Thanks,
Vishnu Priya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2023 07:41 AM
As an admin, in the navigation bar, go to the script include section, search commonUtils, and make sure the Accessible From field is set to All Application Scopes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2023 12:49 AM - edited ‎07-27-2023 12:50 AM
Hi Zach Koch,
Thanks for the solution it worked .But I'm getting undefined value in the employment_status field.In Alert I can see the value for employement status as FT,but in employment status field I'm getting as undefined .It would be great if you could help me with the solution.
Thnaks,
Vishnu Priya V

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2023 08:08 AM
If I am looking at your picture correctly, it doesn't look like any of the values are being set correctly. Your Info message says department should be 7m07 - it admin, but the department is 4A57-TCH Infrastructure.
In the picture you included, it looks like you need to declare your function below the getXMLAnswer call, not in it, and then put your created function as the argument inside getXMLAnswer.
Here is the section I am referring to
Here is the ServiceNow docs page on getXMLAnswer. Take a look at how they declare their function below the getXMLAnswer call, then use it as an argument for the getXMLAnswer function.
I have included a link to the docs page as well