The CreatorCon Call for Content is officially open! Get started here.

Catalog Build form Variable Fields blank on Submission

Raymond Ortiz
ServiceNow Employee
ServiceNow Employee

I'm working on building a request form through the catalog builder and trying to reference some basic user details from the sys_user table such as department, cost center and have these fields auto populate as read-only as the user submits their request. However after submission, the RITM shows the variables as blank even though they were populated correctly when submitting the form. 

 

RaymondOrtiz_0-1744143477563.png

 

7 REPLIES 7

May be @Raymond Ortiz 

 

You yourself would need a servicenow case 😅

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

swapnali ombale
Kilo Sage

Hi @Raymond Ortiz 

 

If auto-populate in ServiceNow's Catalog Builder isn't working as expected, ensure the dependent question's field type is a reference field, the auto-populate configuration is correct, and there are no UI policies hiding the target variable. 
 
Here's a more detailed breakdown of potential issues and solutions:
 
1. Field Type and Reference Fields:
  • Problem: If the variable you're trying to auto-populate is a Lookup Select box, it might not work correctly. 
     
  • Solution: Change the field type to a Reference field. 
     
  • Example: If you're trying to auto-populate a department, make sure the department field is a reference field pointing to the sys_user_group table. 
     
2. Auto-Populate Configuration:
  • Problem: Incorrect configuration in the Auto-Populate tab.
  • Solution:
    • Dependent Question: Ensure the correct variable is selected as the "Dependent Question".
    • Walk Path: Select the correct path to the value you want to populate.
    • Target Variable: Make sure the correct target variable is selected in the "Target Variable" field.
  • Example: If you want to auto-populate the department based on the user, select the user variable as the "Dependent Question" and the department field as the "Target Variable". 
     
3. UI Policies:
  • Problem:
    UI policies can hide the target variable, preventing it from being populated.
  • Solution:
    • Check UI Policies: Review any UI policies that might be affecting the visibility of the target variable.
    • Adjust UI Policies: Modify the UI policies to ensure the target variable is visible when the dependent question is populated. 
       
4. Default Values:
  • Problem:
    If the dependent question has a default value, the auto-populate might not work on initial load.
  • Solution:
    • Remove Default Value: Try removing the default value from the dependent question and see if the auto-populate works.
    • Use Catalog Client Script: If you need a default value, you might need to use a Catalog Client Script to populate the target variable after the dependent question is populated. 
       
5. Scripting:
  • Problem:
    If you're using a script to populate the fields, ensure the script is correctly configured and executed at the right time.
  • Solution:
    • Review Script: Check the script for any errors or logic issues.
    • Adjust Script Execution: Make sure the script is executed after the dependent question is populated.
    • Use g_form.setValue(): If you're using a script, use g_form.setValue() to set the value of the target variable. 

Raymond Ortiz
ServiceNow Employee
ServiceNow Employee

I was able to get most of it resolved by referencing other tables. For example on cost center instead of sys_user using cmn_cost_center. But for title trying u_job_title instead still returns a blank variable on submission.