logo

NJP

How to use the Form component

Import · May 30, 2022 · article

Add the Form component to the Page

  1. Drag and drop the Form component on your page.

Add a "Glide Form" data resource

  1. Go to Data Resources ( icon database on the left toolbar)
  2. Click +Add
  3. Search for "glide form"
  4. In the section, "@servicenow/now-record-form-connected", select "Glide Form"
  5. Click Add

image

Configure the data resource

  1. Set the following values:
  2. Table: User (sys_user)
  3. Sys Id:
  4. 1. Set the value to "-1" if you want to create a new record
    1. Set the value dynamically by referencing a page variable
    2. As an example, we'll set the value to "62826bf03710200044e0bfc8bcbe5df1"

image

Configure the Form component

  1. Select your form component
  2. Go to the component configuration panel and set the following values: (when the value starts with '@', click the dynamic data binding icon first)
  3. 1. Sections: @data.glide_form_1.nowRecordFormBlob.sections
    1. Fields: @data.glide_form_1.nowRecordFormBlob.fields
    2. Table: . Ex: "User (sys_user)"
    3. SysId : @data.glide_form_1.nowRecordFormBlob.sysId

image

Add a Save button

  1. Add a button "Save"
  2. Select the button, go to the Events configuration panel
  3. Set the click event to Glide Form > Save

And here you have a Form ready to be used.

image

Labels:

image

View original source

https://www.servicenow.com/community/developer-articles/how-to-use-the-form-component/ta-p/2297536