Input form screen attributes for inputs
Different types of inputs are available for use in input form screens, and you can use different attributes to configure the inputs.
Use input attributes to define the appearance and set limitations on your inputs. Examples include setting minimum and maximum values, or displaying an input value as a percentage.
General attribute
You can use this attribute with any input form screen, regardless of the input type.
| Attribute | Description |
|---|---|
| DescriptionRenderType | Define a render type for the input description. html: Enables you to use HTML tags to format the text in the Description field of your input. |
Attachment inputs
Use attachment inputs to enable users to attach files in an input form screen. Attachment inputs require a scripted action item and an actionResult object to upload a
file. Note: Attachment inputs are only supported for scripted actions. |
(function WriteBackAction(parm_input, parm_variable, actionResult) {
//other write-back inputs and variables here
actionResult.addAttachment("attach", "incident", gr.getUniqueValue()); //where "attach" is the input name from above screenshot, and “incident” is the table name
})(parm_input, parm_variable, actionResult);
Barcode inputs
Use barcode inputs to scan single or multiple barcodes. Barcodes are machine-readable codes in the form of numbers and a pattern of parallel lines of varying widths. These codes are used to identify items such as products, parts, or assets. You can use this input type to enter information about items into your ServiceNow instance by using your mobile app.
- Barcode inputs can be configured for single scans, multi-scans, or grouped scans. Single scans enable the user to scan only once. In this case, the user must rescan by tapping the scan icon, which clears the scan value. You don't need to configure an attribute for a single scan barcode input.
- Multi-scan inputs can be configured with the MaxEntries attribute. If your input form screen barcode input is configured with the MaxEntries attribute, users can quickly scan multiple barcodes sequentially without leaving the scanning interface.
- Grouped scans can be configured to scan multiple barcodes associated with an asset that must be grouped in a set. To configure a grouped barcode input, you must create a barcode section in the input form screen that has barcode inputs only. Then the section MaxEntries attribute must be configured for the grouped barcode section so that users can scan multiple groups of barcodes.
| Attribute | Description |
|---|---|
| MaxEntries | Used only for configuring multi-scanning and multiple groups of barcodes. Sets the maximum number of barcodes that a user can scan at a time. For example, you can set the value to 5 to
enable users to rescan 5 times. Note: Use this attribute for multi-scan barcode inputs only. If your barcode input is intended for single scans, no attribute is required. |
For information about creating an input form screen with barcode inputs, see Configure input form screens with single and multi-scan barcode inputs and Configure input form screens with grouped scan barcode inputs.
Boolean inputs
Use Boolean inputs for inputs with true or false values. You can configure Boolean inputs to appear either as a check box or as a toggle switch. |
You can use these attributes with Boolean inputs.
| Attribute | Description |
|---|---|
| RenderType | Specify a render type for the Boolean input.
|
Choice inputs
Use choice inputs to give your users options to select from. You can create these choices manually or use an existing table and field to provide the choices. Choice inputs can appear as text or as images. You can configure a choice input to enable users to select a single choice, or multiple choices. |
You can use these attributes with choice inputs.
| Attribute | Description |
|---|---|
| MultiSelect | Option to enable users to select multiple choices for the input. The value must be true or false. |
| Table | The table where the choice field is located. Note: Use this option to use the choices in an existing table and field rather than manually creating choices. You must select a field on this table using the
Field attribute. |
| Field | The field that contains your choices. Note: Use this option to use the choices in an existing table and field rather than manually creating choices. The field defined in this attribute must be on the table defined
in the Table attribute. |
| RenderType | Option to render the choice options as an image for the choice input. The value must be image. |
| EnableSearch | Option to display the search bar. The value must be true or false. |
| SearchPlaceholder | Text that appears in a search bar as a placeholder. |
| SearchType | Defines the query used for search. The value can be starts_with or contains. If this attribute isn’t configured, the instance uses starts_with by default on the display label column. |
Custom map inputs
Use custom map inputs to add a link to an indoor map in your mobile app. Users can use these maps to get directions to and reserve resources such as desks, meeting rooms, or lockers. Admins can also configure a parametrized data item with query conditions that enable sorting and filtering of the custom map input. Important: Custom map inputs that support parametrized data items must only use the ScreenId attribute. Don't use any other type of attribute for custom map inputs that support parametrized data items. If you're modifying an existing custom map input that uses the advanced reference qualifier to use a parametrized data item, use the ScreenId attribute only and remove all other attributes. |
| Attribute | Description |
|---|---|
| CustomMapConfigId | The sys_id of the sys_sg_custom_map_config table. |
| CustomMapDefaultProviderId | The sys_id of the provider record in the sys_sg_custom_map_provider table. |
| CustomMapInputs | The sys_id of the floor in the sys_sg_input table. This value must be entered as a JSON array. |
| ScreenId | The sys_id of a parameterized data item used to sort and filter custom map inputs. Important: This attribute can't be used with any other custom map input attribute. If you use the ScreenId attribute with a custom map input, don't use any other attributes with the
input. |
| TargetTable | Set to sn_wsd_core_space. |
Date/time inputs
Use date/time inputs to enable your users to input date and time values. You can configure the input for date and time, or date only. |
You can use these attributes with date/time inputs.
| Attribute | Description |
|---|---|
| RenderType | Specify a render type for the date/time input.
|
| IncludeTimezone | The time zone of the mobile device where the input is being added. The value must be true or false. When set to true, the mobile client sends the Device Time Zone information along with the date and time value to the back-end instance in the following format: YYYY-MM-DDThh:mm:ss.sssTZD Note:
The Device Time Zone is different from the User Profile Time Zone that is configured on the platform. If this attribute is not configured, the mobile client doesn't include Device Time Zone information in the date/time input values. This behavior is the default. The date/time input values are in the following format: YYYY-MM-DD hh:mm:ss For information about setting up the IncludeTimezone attribute of date/time inputs for different action types, see Date/time input setup for different action item types. For information about action item types, see Configure an action item. |
| MaxRangeDays | Optional attribute that determines whether future dates can be selected when a date/time input is added. This attribute supports both positive and negative integer values. Setting MaxRangeDays to 0 prevents users from selecting future dates and restricts them to current or past dates. Note: MaxRangeDays can be used together with MinRangeDays, MaxRangeHours, and MinRangeHours. |
| MinRangeDays | Optional attribute that determines whether past dates can be selected when a date/time input is added. This attribute supports both positive and negative integer values. Setting MinRangeDays to 0 prevents users from selecting past dates and restricts them to current or future dates. Note: MinRangeDays can be used together with MaxRangeDays, MaxRangeHours, and MinRangeHours. |
| MaxRangeHours | Optional attribute that determines whether future hours can be selected when a date/time input is added. This attribute supports both positive and negative integer values. Setting MaxRangeHours to 0 prevents users from selecting future date times and restricts them to current or past date times. Note: MaxRangeHours can be used together with MaxRangeDays, MinRangeDays, and MinRangeHours. |
| MinRangeHours | Optional attribute that determines whether past hours can be selected when a date/time input is added. This attribute supports both positive and negative integer values. Setting MinRangeHours to 0 prevents users from selecting past date times and restricts them to current or future date times. Note: MinRangeHours can be used together with MaxRangeDays, MinRangeDays, and MaxRangeHours. |
Number inputs
Use number inputs to enable your users to enter numerical values. Define optional minimum and maximum values to define a number range for your input. You can optionally configure a number input to appear as a percentage. By default, number inputs support decimals. |
You can use these attributes with number inputs.
| Attribute | Description |
|---|---|
| RenderType | Specify a render type for the number input.
|
| Max | Specify a maximum value for the input. |
| Min | Specify a minimum value for the input. |
Ranking inputs
Use ranking inputs to enable your users to sort the available choices in order of preference or priority. Users tap and drag the available choices. Choices for the ranking input must be manually defined. |
There are no attributes for ranking inputs other than the general attributes listed in this topic.
Reference inputs
Use reference inputs for inputs that reference a field on a table. These inputs work like reference fields in the forms on your instance. You can configure your reference input with conditions, reference qualifiers, and a search option to help your users find what they need quickly.
The optional search option uses "For text" keyword searches and can search for elements within the mobile view.
You can use these attributes with reference inputs.
| Attribute | Description |
|---|---|
| SourceTable | The source table for your reference qualifier. |
| SourceFieldName | The field name of the referenced field in the source table. |
| TargetTable | The table that you want to target for your reference qualifier. |
The following additional attributes are optional:
| Attribute | Description |
|---|---|
| MultiSelect | Option to enable users to select multiple choices for the input. The value must be true or false. |
| MobileViewId | Mobile view ID (View config) to use for reference list items. |
| EnableSearch | Option to display the search bar. The value must be true or false. |
| SearchPlaceholder | Text that appears in a search bar as a placeholder. |
| Conditions | Enter an encoded query to apply conditions to your reference list. For details on creating these queries, see Encoded query strings. |
| SearchType | Defines the query used for search. The value can be starts_with or contains. If this attribute isn’t configured, the instance uses starts_with by default on the display label column. |
This example creates an input form screen input for the Assigned to field on the Incident [incident] table. To create this input, you use the three required attributes: TargetTable, SourceTable, and SourceFieldName.
- Your users select from a list of users to assign the incident to. So, you set the TargetTable attribute to sys_user.
- Because you're adding the user to an incident record, the SourceTable attribute is set to incident.
- Set the SourceFieldName to assigned_to so that the selected user is assigned to the Assigned to field.
Signature inputs
Use signature inputs to capture e-signatures on an input form screen. Signature inputs can be included on input form screen sections or pages.
You can use the optional IsOverlay attribute with signature inputs. By default, signatures are rendered in the full modal window. When the IsOverlay attribute Value is set to true, signatures are rendered in a half modal window.
| Attribute | Description |
|---|---|
| IsOverlay | Sets whether the signature input is opened in a half modal window. You can set the Value to true or false. A value of
true configures the signature to open in a half modal window. Note: If the signature input is configured as the only input on a page and the isOverlay attribute is set to
true, the isOverlay attribute is ignored, and the signature input is displayed in the full screen. |
For information about creating an input form screen with signature inputs, see Configure input form screens with signature inputs.
String inputs
Use string inputs for text input. You can define a maximum character length for this input. |
You can use these attributes with string inputs.
| Attribute | Description |
|---|---|
| Inline | Option to show the input inline, or to open the input in a separate modal. The value must be true or false. |
| MaxLength | Maximum number of characters for the input value. |
| ShowDeleteAll | Option to display a delete button whenever there is text in the input field. This value must be true or false, and is set to false by default. |
| ConfirmDeletion | Option to show the user a confirmation message before text is deleted when using ShowDeleteAll. The value must be true or false, and is set to true by default. |
Screen inputs
Use a screen input to transform a list screen into selectable list input. Users can select multiple list items and perform a write-back operation to the cache.
You can use these attributes with screen inputs.
| Attribute | Description |
|---|---|
| ScreenId | Configures the list screen that is used for the selectable list input. The value is the sys_id of the list screen. |
| GetDataFromParent | Transforms a list screen from a parent screen into the selectable list input. The filters that are applied to the parent list screen are carried over to the screen input. Enter true to enable this attribute. By default, it's turned off on the instance. |