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. |
| DataSourceId | Define this attribute whenever you create a data source mechanism to load input values. For more information, see Data sources. Remarque : This attribute is not supported with signature inputs. |
| ElementIdentifier | Define this attribute whenever you create a data source mechanism to load input values. For more information, see Data sources. Remarque : This attribute is not supported with signature inputs. |
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.
Remarque : 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);
- Restrict attachment sources to users
- You have the option to limit the origins of attachments, to ensure that images are sourced from one or all of the following:
- on-site via a camera
- from the user’s phone gallery
- from the user’s file system
In the Input attribute record, select HiddenAttachmentSources. Select either camera, files or gallery, from the Value field and then select Save. Repeat the process if you want to include more than one attachment source. For more information, see Define attachment sources available to users.
Attribute Description HiddenAttachmentSources Decide where you don’t want images sourced from. Select one of the following source values: camera, files or gallery, from the Value field. Remarque :To avoid images and files being obtained from more than one source, add additional HiddenAttachmentSources attributes after you save the attribute you are currently configuring.
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. Remarque : 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. Configure a choice input to enable users to select a single choice, or multiple choices. The option to select more than one chip in a category is marked by a + sign on the chips. Define the number of chips to display, enabling the user to see all options available on a single input form screen. If the defined number of chips to display exceed the defined amount, a See all button is displayed. Tap on the See all button to open a page with all the options listed. |
|
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. Multi-select options are indicated with a "+" sign on the chip. |
| Table | The table where the choice field is located. Remarque : 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. Remarque : 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. |
| Inline | Option to select how to display your choice inputs. By default, the value is false, meaning that the choice display is on the same screen, removing the need to navigate to a separate
screen. For a visual example, see the image in the Choice inputs introduction. If you select true, a list-type option displays where users are required to navigate to an additional screen, after a selection is made. |
| InlineMaxItems | Option to define the number of chips to display within an input form screen section. The following inputs in the Value field are available:
|
| 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 Remarque :
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. Remarque :
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. Remarque :
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. Remarque :
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. Remarque :
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. To have the basic box input for a number, within an Input record, complete all the mandatory fields and select Number in the Input type field. |
| Attribute | Description |
|---|---|
| CustomErrorMessage | Sets a custom error message that you can specify. This message displays when the associated UI rule condition is met. |
| Max | Specify a maximum value for the input. |
| Min | Specify a minimum value for the input. |
| RenderType | Specify a render type for the number input.
Remarque : For a table showing which attributes can be used with which render type, see Number render types and compatible input attributes. |
| SkipValidationWhenHidden | Remarque : Can be set to either true or false. It's set to false by
default, which means that by default the associated UI rule validation is run on the hidden inputs. Only set this to true when you want to skip the validation on hidden inputs.This attribute can only be used with line and percentage render types. |
| Attribute | Description |
|---|---|
| DefaultValue |
The value displayed when the user first views the slider. If no value is entered, the value displayed is zero. The default value must be between the min and max values. Remarque :
This defined value is the the starting point, unless a loading mechanism, which takes priority, is configured. See, Loading mechanisms for input form screens. |
| StepSize | The size of each step on the slider. The steps must be a number divisible between the max and min number. For example the min number is 20 and the max number is 80, the StepSize can be numbers like 2, 5, or 10. |
| ReferencePoint | When set to true a marker is added to the slider, providing a visual reference point for the user. Remarque : For the sake of visual clarity, this input attribute should not be used with the
input attribute VisualStepsEnabled. |
| VisualStepsEnabled | When set to true the slider displays visual increments based on the specified StepSize input attribute. Remarque : For the sake of visual clarity, this input attribute should not be used with
the input attribute ReferencePoint. |
| EnforceStepSize | When set to true users are unable to enter a value in the number box that does not align with the StepSize value. |
| Decoration | Defines sections on the slider with corresponding labels that appear when a user taps a section or enters a value. Each section can be associated with a specific color to aid visual representation. For more information, see Configure a slider option for a number 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. Remarque : 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. |
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. |