Action functions enable the user to change something in the database. For example, making an update or adding a comment to a record requires an action function.

Before you begin

Role required: admin

Procedure

  1. Navigate to All > System Mobile > Mobile App Builder.
    The Mobile App Builder opens in a new browser tab and displays the application scope selection screen.
  2. Search for the application scope you are working in and then select the name of the application screen.
    The Mobile App Builder categories home screen displays.
  3. Select Functions in the menu, and then select New.
  4. On the form, fill in the fields.
    Table 1. Function fields
    Field Description
    Properties
    Name The name of the function. Choose a name that is easy to identify.
    Description Additional information about the function.
    Type The type of function. Select Action item.
    Context The level to apply the action to.
    • Record: Applies an action at the record level. For example, use this option to create a button that changes the state of a record. You can set the context to Record for actions on a particular field, a particular record, or swipe actions. If the action function includes a UI parameter with the Input source field set to Auto fill, you must specify the table in the Table field.
    • Global: Applies an action at the global, or list level. For example, use this option to add a button that creates a record. Do not use the Global setting for actions that are in the context of a record, or actions that include a UI parameter with the Input source field set to Auto fill.
    For more information on button locations, see Associate a function with a location in the app.
    Available offline Whether this function is available when the device is offline.
    Note: This option is only supported on the ServiceNow Mobile Agent app.
    Action item Action item to associate with the action. For more information, see Configure an action item.
    Settings
    Allow images upload Allows images to be uploaded. Images are stored in the attachment [sys_attachment] table.
    Show signature field Requires a user signature before submitting the action. Users can either sign with their fingers or type their names in the signature field. If Allow images upload is selected, an image of the signature is sent to the Signature Images [signature_image] table when the action executes. If selected, the signature form displays on a separate page. To overlay the signature form, use the Signature option in the Preconditions field.
    Use Overlay Overlays a text input parameter on the current details screen. Exactly one text input parameter must be defined for the action. If this option is not defined, the input parameter displays on a separate screen.
    Preconditions Select an option to require user confirmation before submitting the action.
    • None: Do not require user confirmation. This option is the default.
    • HR Task Signature: Require a user signature before submitting the action. Users can either sign with their fingers or type their names in the signature field. If Allow images upload is selected, an image of the signature is sent to the Signature Images [signature_image] table when the action executes. When this option is selected, the signature form overlays the current screen.
    • HR Task Credentials: Require users to input their credentials before submitting the action. This option is supported only with local authentication.
    • Re-authentication: Requires users to re-authenticate their credentials before executing an action. For more information, see Configure mobile re-authentication system properties.
    Data
    Table

    The table that the action applies to. Selecting a table is required if the Context is set to Record.

    If the Context is set to Global, selecting a table is optional.

    Conditions
    Condition Conditions that must be met to use the action. For example, you could prevent users from resolving an incident that is in a state of closed, resolved, or canceled.
    Messages
    Show confirmation message Displays a confirmation message to verify whether a user wants to continue with the action.
    Confirmation message The confirmation message to display.
    Note: Displays only if Show confirmation message is selected.
    Confirm label Label of the button to confirm the action.
    Note: Displays only if Show confirmation message is selected.
    Cancel label Label of the button to cancel the action.
    Note: Displays only if Show confirmation message is selected.
    Success message Text for a success confirmation message. Use curly braces to create a dynamic success message. For example, {{number}} has successfully updated.
    Failure message Text for a failure confirmation message. Use curly braces to create a dynamic failure message. For example, {{number}} could not be updated.
    Acknowledgment messages
    Show acknowledgment text Require user acknowledgment before submitting the action. If this field is enabled, the Context field must be Record.
    Acknowledgment field Field that includes the acknowledgment text you want to display to the user. Select the table for the field in the Data area. Only String fields are supported.
    Note: Displays only if Show acknowledgment text is selected.
    Confirm label Label for the confirmation button that appears below the acknowledgment text. The default value is I Agree.
    Note: Displays only if Show acknowledgment text is selected.
    Action completion
    Refresh full screen after action Option for the current screen to automatically refresh when an action completes.

    This option is available only when Context is set to Global.

    Note: The refresh option is supported for screens (applets) but not launcher screens.
    Jump to previous screen Redirects the user to the previous screen after completing an action.
    Show refresh on previous screen Shows a New Update message after the user completes the action and redirects back to previous screen.
    Jump to screen after successful action completion Displays additional screen navigation configuration options after the user completes an action. Use this field to determine whether user interaction is required before navigating to a specified screen.

    This option is available only when a table is selected in the Condition area of the form.

    Jump to screen without user interaction Sends the user to the destination screen.
    • If selected, redirection to the destination screen occurs automatically without user interaction.
    • If not selected, redirection occurs only with user interaction on a success message. To define a success message, you must complete the mandatory fields in the Messages section of the form.
    Note: This option is available only when Jump to screen after successful action completion is selected.
    Auto-populate screen parameters Automatically populates parameters in the destination screen.
    Note: This option is available only when Jump to screen after successful action completion is selected.
    Jump to destination screen Specifies the screen that the user is redirected to after successful action completion. This screen displays newly created records, if available.
    Note: This option is available only when Jump to screen after successful action completion is selected.
    UI parameters Automatically populates parameters in the destination screen.
    Note: This option is available only when Jumpt to screen after successful action completion is selected.
    Grouped inputs This field is not used to configure an action function. Grouped input enables the users to scan several barcodes sequentially. You can configure grouped inputs with UI Parameters to accept multiple barcode scans. For information about grouped inputs, see Configure a grouped input for multiple scans
    Button attributes Specifies an additional attribute for a button. Select New to configure this option. You can select from the following button attributes:
    • alerts_require_dismissal: The button attribute when set to true enables the banner messages to persist until the user dismisses it. By default, banner messages are automatically dismissed.
    • used_for_deeplink: The button attribute when set to true determines that the button is used for deep linking. For more information, see Deep linking for mobile.
    • trigger_offline_cache_download: The button attribute when set to true triggers offline cache generation. After the cache is successfully generated, a download of it is triggered.
    • check_acl_on_url_parameter_field: When this button attribute is selected and set to true, any field in the URL string is checked against the ACL (access control list). For example, a string like {{meeting_id}}. If a field does not pass this check, the field value is not included in the URL. By default, the URL parameter field is not checked against the ACL for backward compatibility.
    Role access Limit user access to an action by role.
    Note: While all the options in the Action completion area of the form can be set, their actions might overlap with each other. Make sure that you test the settings so the results produce the outcomes that you expect.
  5. Select Save.

What to do next

After you create an action function, you must associate it with a specific location in the mobile app. You can add an action function to a top menu, a swipe action, or to a specific field. For more information on associating the action function to a location, see Associate a function with a location in the app.