logo

NJP

Pre-populating a Form Field Inside a UI Builder Modal: Using the Form Controller Query

New article articles in ServiceNow Community · Sep 14, 2026 · article

From an Application Vulnerable Item (sn_vul_app_vulnerability) record, a modal had to open a new record form (Story table) with the Configuration Item field already filled in with the CI from the source AVUL record.

Event handlers of the "set field value" type did not work.

 

Resolution

Instead of setting the value after the form renders, pass it into the form through the Form Controller Query property, which resolves before the form initializes.

1. Make the source value available on the modal page

Add a Look up a single record data resource against sn_vul_app_vulnerability, filtered by the source record's sys_id, returning the CI field.

2. Configure the Form Controller

Field Value
Table target table (Story)
Sys ID -1 (new record)
Query encoded query, bound dynamically

 

Screenshot 2026-09-14 at 09.24.55.png

 

3. Build the encoded query with CONCAT

In the Bind data to Query editor:

`CONCAT("cmdb_ci=", @data.look_up_a_single_record.results.cmdb_ci.value)`

Screenshot 2026-09-14 at 09.25.01.png

 

Use the field name (not the label), and for reference fields pass the sys_id (.value).

View original source

https://www.servicenow.com/community/secops-articles/pre-populating-a-form-field-inside-a-ui-builder-modal-using-the/ta-p/3597595