NSO Service Model form field reference

Guidelines

  • To view device elements from a service model in Form Builder, specify where to find the YANG files. In NSO adapter version 4 and higher, configure the yangdirs property in the adapter.
  • In older NSO adapter versions (pre-version 4), include your YANG schemas in the load-path of ncs.conf.
  • For more information, see the NSO NETCONF adapter documentation.

Create a form using an NSO YANG service model

1

Select a service

Select the appropriate service from the Data Elements dropdown list. The leafs defined in the model display automatically below the dropdown.

2

Assign fields

Drag and drop the fields onto the form. By default, each field label matches the leaf name from the service model. Click a field and type a new label to change it.

3

Assign lists

Assign the Lists defined in NSO to the form.

4

Group fields in containers

Click Add Container to group fields together. Toggle the direction icon (double arrow in the left corner) to arrange containers horizontally or vertically. Containers can be nested within other containers.

5

Name and save

Assign a name to the form and click Save.

Form built from an NSO YANG service model

Meta Data fields

In addition to leafs from an NSO YANG service model, you can assign Meta Data Fields to a form. The following field types are available:

  • Text Box — Allows any characters.
  • Number Field — Accepts only numerical values.
  • Checkbox — A boolean field that can be checked or unchecked.
  • Dropdown — Accepts one selected option from a dropdown list.
Meta Data Fields

Preview a form

Once a form is saved, click the Form Preview button (eye icon) in the title bar to preview the form.

Form preview

All form fields are editable in Preview mode, including those configured as a leaf reference or enumeration in the YANG service model, just as they are when the form is used in a workflow.

Dropdown generated by an NSO leaf reference in preview mode

Enable or disable constraints

The Validate Constraints checkbox allows you to bypass the must statement validations defined in the YANG service models. The checkbox works at the form level — disabling it disables validations for the entire form. It does not disable other form validations.

Examples

The example below shows a form with a leaf description that has a length constraint (3 to 8 characters) and a must statement (leafWithMust) that requires description to be exactly 5 characters.

Form with must statement constraints

When description has only two characters, an error message displays for the leaf:

Form with a validation error

Disabling Validate Constraints does not remove the length error for the field:

Form with error constraint disabled

When description has three characters, the length validation passes — but leafWithMust now fails because it requires exactly 5 characters:

Form with must statement error

When Validate Constraints is unchecked, the must statement validation is disabled and the form reports no errors:

Form with no errors after disabling validate constraints

Mandatory vs. required field constraint validation

Some fields are mandatory — they must contain a value and this cannot be overridden. Mandatory fields always display a red asterisk (*) or the text “Required” next to the field label. Constraints can also restrict values based on the value of another field. If expected data is missing or incorrectly formatted, an error message displays.

Examples

Mandatory constraint validation:

Mandatory fields

For required field constraint validation, there is a dependency between the key and the required field element. When a nested table key is not entered, the form skips the table row:

Required fields with dependency on table key

When the table key is missing, the form submits but the table row is ignored regardless of whether Field A or Field B was filled in:

Missing table key

Output (missing key):

1{
2 "name": [
3 "test"
4 ]
5}

When the table key is present but required fields are empty, the form cannot be submitted:

Missing required field

A successful submission includes a valid table key and all required fields:

Valid key and required fields

Output (successful):

1{
2 "name": [
3 "testValCrit"
4 ],
5 "table": [
6 [
7 {
8 "key": "1",
9 "fieldA": "A",
10 "fieldB": "B"
11 }
12 ]
13 ]
14}

Resources

Edit form field properties

1

Open the Configure dialog

Hover over the field and click the Configure Properties icon in the top-right corner of the field. The Configure dialog opens.

Configure Properties button
Configure Properties dialog
PropertyDescription
Custom LabelAdds a custom label above the field.
Field KeyAn internal value that identifies the field in the workflow engine. Update this only for a Meta Data Field — do not modify it when the field is part of an NSO YANG service model.
Info / Tool TipAdds a custom tooltip that displays when the cursor is placed over the field.
RequiredWhen checked, the form cannot be submitted unless a value has been entered in the field.
Read-OnlyWhen checked, the field is visible but cannot be modified by users.
Hide FieldWhen checked, the field is hidden from users but remains available to the workflow engine.
Min LengthThe minimum number of characters a Text field must contain before it can be submitted.
Max LengthThe maximum number of characters a Text field may contain before it can be submitted.
Regex PatternsDoes not apply to fields assigned an NSO leaf reference or enumeration.
Custom Error MessageAdds a custom error message when user input is invalid. Requires that Field Type be defined.

Delete a form field

Click the trashcan icon on the field to remove it.

Remove a form field