Skip to main content

Insert Record

Description

ServiceNow: Insert Record plugin step inserts a Record (e.g. Incident, Request, Problem, Change etc.) in ServiceNow application.

Field Descriptions

No.Field NameDescription
1Step NameName of the step. This name must be unique within a workflow.
Connection:
2Grant TypeSelect the type of grant from OAuth 2.0 or Basic Auth.
Data type: String
Mandatory: Yes

Notes:
  • Client ID, Client Secret, and Refresh Token are displayed when the grant type is OAuth 2.0.
  • Username and Password are displayed when the grant type is Basic Auth.
3ServiceNow Base URLSpecify the URL of the ServiceNow instance.
e.g. https://XXXXXX.service-now.com
4Client IDSpecify the Client ID of the registered application on the ServiceNow instance.
Data type: String
Mandatory: Yes
Note: Available when the grant type is OAuth 2.0.
5Client SecretSpecify the Client Secret of the registered application on the ServiceNow instance.
Data type: String
Mandatory: Yes
Note: Available when the grant type is OAuth 2.0.
5.aCheckbox: Accept Value as variable/staticLeave the checkbox unchecked to select the client secret from a field in previous steps (dropdown).
Check the checkbox to display the client secret field as a text box.
5.bClient SecretEncrypted and not stored in the .psw file. Enter the Client Secret using the widget. The widget supports both text (static/environment variable) and combo (dropdown from previous steps).
Mandatory: Yes
Behavior:
If the checkbox is enabled, this field appears as a text box. If disabled, it appears as a dropdown.
6Refresh TokenSpecify the refresh token to obtain a new access token.
Data type: String
Mandatory: Yes
Note: Available when the grant type is OAuth 2.0.
6.aCheckbox: Accept Value as variable/staticLeave the checkbox unchecked to select the refresh token from a field in previous steps (dropdown).
Check the checkbox to display the refresh token field as a text box.
6.bRefresh TokenEncrypted and not stored in the .psw file. Enter the refresh token using the widget. The widget supports both text (static/environment variable) and combo (dropdown from previous steps).
Mandatory: Yes
Behavior:
If the checkbox is enabled, this field appears as a text box. If disabled, it appears as a dropdown.
7UsernameSpecify the username to authenticate with the ServiceNow instance.
Data type: String
Mandatory: Yes
Note: Available when the grant type is Basic Auth.
8PasswordSpecify the password to authenticate with the ServiceNow instance.
Note: Available when the grant type is Basic Auth.
8.aCheckbox: Accept Value as variable/staticLeave the checkbox unchecked to select the password from a field in previous steps (dropdown).
Check the checkbox to display the password field as a text box.
8.bPasswordPassword for authentication is encrypted and not stored in the .psw file. Enter the password using the widget. The widget supports both text (static/environment variable) and combo (dropdown from previous steps).
Mandatory: Yes
Behavior:
If the checkbox is enabled, this field appears as a text box. If disabled, it appears as a dropdown.
9Test ConnectionClick Test Connection to verify whether the connection is established.
Mandatory fields: ServiceNow Base URL, Username, and Password.

Note: This button does not support values sourced from previous steps, as they are only available at runtime. Static values and environment variables are supported.
Once the connection is successful, all requisite forms and fields in Input and Output sections are populated. The connection fields may then be replaced with values from previous steps.

Input Tab

No.Field NameDescription
1Form NameA form name needs to be selected from the form explorer in which a document/record is to be created. A form explorer is opened by clicking the Get Forms button.
Note: Listeners on Form Name do not work for previous step variables, static values or environment variables.
2Button: GetClick Get Forms Button to open Form explorer. Select a form from the form names displayed or filter form names using the filter field.
3Accept fields as JSONEnable checkbox to accept field names as JSON input.
4JSONIf ‘Accept Fields as JSON’ checkbox is enabled, this field is activated. Choose a field containing the JSON text. JSON text should contain key-value pairs enclosed by double quotes (“) enclosure with a colon separating them. Key-value pairs denote fields and their values to populate. Provide all the required or mandatory fields as well as other fields to be updated as keys in the JSON.

Note:
• Lookup field values must exactly match existing values in the Service Now instance else it is ignored.
• The JSON could be from any input step such as Generate rows, Text File input, Excel Input et al. In SNOW steps JSON text can only be accepted from input fields from previous steps and not as files directly. At least one input field must be provided. Either using JSON or Table Fields.
alt text
Sample JSON text for inserting an Incident record:
{“short_description”:”Test_Incident”}

Sample JSON text for inserting a Problem record:
Following is a sample JSON for inserting a record in Problem form. This JSON text has one key-value pair denoting field and its value to populate. alt text For example, for Problem {"short_description":"Hello There!","work_notes":"Test Inserting Record."}
Tabular Fields
5Variable Field NameThis is an optional field. Choose a field in input stream from drop down list or provide a user or system defined variable.
6Static Field NameOn click of this column field, it opens a dialog with the list of available form fields of the provided Form Name.
The name of the fields to be inserted should be selected. Multiple fields can be selected from the list displayed on click. The selected field’s values below will be inserted in the record.

Validation: The plugin validates field names from remedy server.

If ‘Static Field Name’ and ‘Variable Field Name’, both are provided in the same row in ‘Table Fields’ then ‘Static Field Name’ will be considered to build the JSON to insert a record.
7Field ValueProvide field values to be inserted in the corresponding chosen fields.

Following, is a sample snapshot of input tab with Table Fields with Static Field Name.
alt text
Following, is a sample snapshot of input tab with Table Fields with Variable Field Name. alt text

Note:
If the selected Field Name is mapped with any Lookup List on the backend then, in that case, it will accept only valid mapped values in the Field Value and the ticket will be created. But if an invalid value is provided to such Fields then the ticket will take the default value mapped with that Field on the backend.

Output Tab:

No.Field NameDescription
Output Fields:
1Record NumberHolds the document/record id of the request created in service-now.
2Sys IDEach record in the instance is identified by a unique 32-character GUID (Globally Unique ID) called a Sys ID (sys_id). Holds the sysid of the record created.
3ResultProvide a field name to hold the result of the step.

Confirmation Buttons:

No.Field NameDescription
1OKClick OK to confirm Insert operation.
Note: User must have appropriate permissions in ServiceNow to insert a record through ServiceNow Insert Plugin.
2CancelClick Cancel to Cancel the operation.