UI Framework Custom Component Add Default Form Controller and Prepopulate Properties
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 09:55 AM
I am working on a custom component using the ServiceNow CLI. I am trying to get my component to mimic part of the OOB form macroponent (sys_ux_macroponent) from the @Servicenow/now-record-form-connected application.
When the OOB form component is added to the page using UI Builder it automatically adds a new Form Controller to data resources and the components properties (table, sys id, sections, fields, related lists...) are prepopulated using the controller. When my component gets added to UI Builder I would like the OOB form controller to be added to data resources and from that I want the properties table and fields, which are on my component, to be prepopulated using the controller.
The overall goal is to have the record on the page be passed into the component without having the user do anything. If someone can point me in the direction of what code to add to my components index.js createCustomElement() function and what to change in the now-ui.json file that would be amazing! There might also be a simpler way to accomplish this.