
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
02-12-2023 09:23 PM - edited 07-30-2024 10:18 AM
Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
Hi there,
Last week I made a LinkedIn post about the new Utah release feature "Auto-populate a variable". A minor post, though wow so many interest in it! Personally for me this is also the "wow" feature of the Utah release. Such a minor new feature, though potentially a big impact for everyone working on Service Catalog. A lot of use cases for populating Variables through Catalog Client Script (or Catalog UI Policy using the Script fields) can be reverted into using the "Auto-populate" option.
Auto-populate
Let's immediately jump into the Auto-populate functionality. This is what the Auto-populate looks like on a Variable:
That's it. A new section, you select the Dependent question which will be a Variable of type reference within your Catalog Item, select the Reference, and choose the Dot walk path. You can actually dotwalk, so you are not limited to only the fields on the Reference table.
Actually there's not much more to write on this, the Auto-populate functionality is just so straightforward! Have a Variable of type reference on your Catalog Item, create a new Variable that you want to Auto-populate and fill in the three fields under the new Auto-populate section, and that’s it.
While testing this, the responsiveness looks really good (perhaps even better than GlideAjax with getXMLAnswer), it works also onLoad, and when clearing the dependent Variable the Auto-populated Variable will also be cleared.
Note: You might have noticed that the release notes on the ServiceNow Docs mentions this new functionality using Catalog Builder. Though like shown above, Catalog Builder is not mandatory to achieve the Auto-populate functionality.
Pre-Utah
With the Quebec release ServiceNow did introduce "Catalog Data Lookup Definitions". A nice improvement, though just a bit too many steps to get it working. Also Catalog Data Lookup Definitions don't work onLoad.
Other methods to Auto-populate a Variable would be methods like using GlideAjax (ideally with getXMLAnswer), getReference, etcetera. While using GlideAjax works well, it can be a bit complex and is a time-consuming task to develop. Because of this a lot of developers use the lesser method of getReference.
Read more about this subject in one of my earlier articles: Client Side Scripting: Go for GlideAjax (with getXMLAnswer)!
---
And that's it . Hope you like it. If any questions or remarks, let me know!
C |
If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.
Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in? |
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
4x ServiceNow Developer MVP
4x ServiceNow Community MVP
---
- 39,233 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi
Thanks for explaining the feature. i have upgraded my instance to Utah, but still i am not able to see the auto-populate feature in catalog variable. am i missing something. Pleas let me know. thanks in advance.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi there,
Have you checked that this is not due to earlier customizations done? And therefore form layout etc not being updated?
Kind regards,
Mark
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Mark,
Thank you so much. It was due to customization. now I added the section to the variable. Thanks!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
thanks for explaining, this help me a lot
then my next requirement for auto-populating is, need to populate all yellow variable based on/depending selected product model, thanks!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi!Thank you for explain!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I appreciate the post--sounds like a useful feature. I have the "Auto-populate" option, but when I tried to use it for the first time, it only listed 17 questions on my request form as being available for the auto-poulation to be dependent on. Is that because the variable on which it depends is in a custom table?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
CORRECTION--it listed only THREE of the 17 questions on my request form.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello,
Any details that you can share about your setup?
Kind regards,
Mark
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I have a catalog request form that needs to get two fields from a custom table I added in my DEV environment. The fields I need in the first question is u_facilityjobcode, and the field I need in the second question is u_facilityjobcodename from the same record. Both are obviously reference type variables.
I was able to select the table in the correct table in the Auto-populate tab of the second question (once I used the data table instead of the data load staging table for the first question🙄). And I selected FacilityJobCodeName in the Dot walk path field.
I don't know if it matters, but I also added ref_auto_completer=AJAXTableCompleter,ref_ac_columns=user_name;email,ref_ac_columns_search=true to the Variable attributes on the first field (the one pulling the u_facilityjobcode field).
But, when I try the form and select a job code it does not auto-populate the job code name.
I have no Catalog UI Policies related to either of those fields except to hide the first (mandatory) field if a third field is selected.
Here is the table structure:
Table | Column name | Column label | Type | Reference | Default value |
u_lawsonjobcodesglobal | Collection | ||||
u_lawsonjobcodesglobal | sys_created_by | Created by | String | ||
u_lawsonjobcodesglobal | sys_created_on | Created | Date/Time | ||
u_lawsonjobcodesglobal | sys_id | Sys ID | Sys ID (GUID) | ||
u_lawsonjobcodesglobal | sys_mod_count | Updates | Integer | ||
u_lawsonjobcodesglobal | sys_updated_by | Updated by | String | ||
u_lawsonjobcodesglobal | sys_updated_on | Updated | Date/Time | ||
u_lawsonjobcodesglobal | u_facilitydepartmentid | FacilityDepartmentID | String | ||
u_lawsonjobcodesglobal | u_facilitydepartmentname | FacilityDepartmentName | String | ||
u_lawsonjobcodesglobal | u_facilityid | FacilityID | String | ||
u_lawsonjobcodesglobal | u_facilityname | FacilityName | String | ||
u_lawsonjobcodesglobal | u_facility_job_code | FacilityJobCode | String | ||
u_lawsonjobcodesglobal | u_facility_job_code_name_job_titlefacilityjobcodename | FacilityJobCodeName | String |
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Variables present in variable set doesnt appear in dependent question field. Any ideas on how to choose those variables?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Mark Roethof Thanks for explaining.
I have a doubt. On the form level it is auto-populating and displays the data whereas when we submit the request, in the RITM and TASK the value in the variable is empty.
Is this functionality not storing the data when we submit the request?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi there,
It should store the data, so sounds like you have a different issue. If you need help on that, do post a new question on the community so I or others will spot your question and might be able to help.
Kind regards,
Mark
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Per ServiceNow support auto-populate does not work with custom tables.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello,
I have tested the new feature "Auto populate" and it's working fine when I'm using it from ServiceNow.
but If I create an item from API, the fileds with auto populate functionality is not working. Fields stay blank.
Do you know if a configuration must be updated at API level for having this auto populate functionality working ?
Thanks
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Mark Roethof Are there any restrictions for non-roled users viewing the auto-populated variables from the Employee Center? I previously had a GlideAjax script that I replaced with Auto-Populate and now the non-roled users can't see the auto-populated information on the portal.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I am having the same issue that if a user doesn't have access to the other (than the reference field) fields of the table we are referencing, it will not populate the values in the variable for the user.
I think @Tehilla Garfink is having the same issue.
@Ankur Bawiskar :Any ideas?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
The reason why it is not working for users with role snc_external is ACL for this API "Get Dynamic Value"
/api/sn_sc/servicecatalog/variables/{sys_id}/dynamic_value
ACL is "Scripted REST External Default" which reject access for all users with role snc_external.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
And ServiceNow opened problem: "Auto population of the variable of service catalog is not working for external user" - fix is planned for
Washington | Q2-2024 |
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I have the auto-populate configured and working correctly. Only issue is I can't set the variable to read only either by checking Read only in the variable, via onLoad Client Script, or via UI Policy.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
An issue I found is that Auto-populate doesn't work when the question/variable to be populated is hidden by UI Policy.
Scenario:
question/variable #1 = user table reference
question/variable #2 = yes/no question
question/variable #3 = location table reference set to auto-populate from question/variable #1, but hidden by UI Policy unless question/variable #2 is "yes"
In this scenario question/variable #3 does not get populated because it isn't visible at the time that question/variable #1 is populated. By comparison, Catalog Client Script "On Change" will populate it, even when hidden by UI Policy.
EDIT:
Turns out the issue wasn't auto-population. There was a UI Policy that had "Clear the variable value" set to "true". Changing that to "false" allowed the auto-population value to persist between question/variable #3 being visible and/or hidden.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Himanshu22 & @Tehilla Garfink Did you find a solution? I have the same issue. Auto-Populate doesn't work for my internal users who do not have support roles (like ITIL)
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Mark Roethof i did the same steps you mentioned above, but
Auto-populated variable is visible on Form Level but not in RITM and Task
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Does this feature work cross-scope? I built a variable set in the Customer Service application with a Contact Name variable that references the the Contact [customer_contact] table, an Account variable that references the Account [customer_account] table, and a couple of string fields to display information that I'm using the Auto-Populate feature to populate. The Record Producer that the variable set is associatedWhen I (admin) select a Contact from the catalog item form, there are no issues and the fields populate correctly. When I impersonate a Contact, I receive an error message and none of the fields auto-populate. Has anyone else experienced this issue?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I really like this option, however, I do wish there was an addition to it. I wish there were an option to auto-populate but still allow the user to change to a different option if needed. Or if the field to populate from is blank to still list the available options to choose from.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Mark
Thanks for your article. I have found an issue though. I created 2 reference fields and set up the Auto-populate and the fields were populated correctly. I then needed to hide/show those fields based on the content of one of them. Even though the fields on the Record Producer were populated correctly, when my OnLoad script read them, they were blank.
I finally wound up using some JS code in the Default value tab to populate the fields and then my script was able to read the correct value.
So, it seems like the order of execution is such that the Script OnLoad script ran before the Auto-populate.
The end result is that you can't use the Auto-populate feature if you need to test the content of a field during OnLoad.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello all,
Has anyone else had any issues with using the new Auto-populate feature on dates? I'm having some issues with it not taking into account a user's date format preference. So when it fills in the date on the form, it uses the system default instead of the user's preference. But the form expects the user's preference format, so it will throw an error on submit.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
For me the auto populate variable does display but when the request is submitted it does not persist and value is empty on RITM
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I've tried to apply so that the field is displayed via Form Layout, but it will not appear... Any ideas what I'm missing?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for bringing this to us, very helpful feature.