Skip to Content
Knowledge is Power, so learn 🎉
Tutorial17 03 2025Servicenow Custom App Development Guide

From Zero to Custom App Hero: A Practical Guide to Building in ServiceNow

ServiceNow is renowned as a powerful platform for streamlining IT service management (ITSM) processes. However, its true potential extends far beyond ITSM. ServiceNow’s application development capabilities allow you to build custom applications tailored to your specific business needs, automating workflows, improving efficiency, and gaining a competitive edge. This guide will take you from ground zero to building your own custom apps in ServiceNow, providing practical examples and referencing valuable resources along the way.

Understanding the ServiceNow Application Development Landscape

Before diving into development, it’s crucial to grasp the foundational elements of application building in ServiceNow. Think of it as understanding the toolkit before starting a construction project.

1. Tables: Tables are the fundamental data structures in ServiceNow, similar to tables in a relational database. They hold the information your application needs to manage. Common examples include:

  • Incident: Used in ITSM to track incidents.
  • Change Request: Used in ITSM to manage changes to IT systems.
  • User: Contains user information.

2. Forms: Forms provide the user interface for interacting with data stored in tables. They display fields, allow users to input data, and trigger actions.

3. Client Scripts: These scripts execute in the user’s browser, enabling dynamic behavior on forms. For example, you can use client scripts to:

  • Validate user input.
  • Show or hide fields based on other field values.
  • Make read-only based on specific conditions.

4. Business Rules: Business rules execute on the server-side, performing actions based on table events (e.g., when a record is inserted, updated, or deleted). Examples include:

  • Sending notifications when a record is updated.
  • Calculating field values automatically.
  • Preventing unauthorized modifications.

5. Workflows: Workflows automate multi-step processes, orchestrating tasks and approvals. Think of them as digital assembly lines. Examples include:

  • Approval processes for change requests.
  • Automated onboarding workflows for new employees.
  • Incident resolution workflows.

6. Script Includes: Reusable server-side scripts that can be called from other scripts, like business rules or workflows. They promote code reusability and maintainability.

7. UI Policies: UI policies allow you to dynamically control the behavior and appearance of forms without writing code. They’re useful for simple form customizations.

8. Application Scoping: Application scoping provides a boundary for your application, isolating it from other applications and the base system. This is crucial for security and preventing conflicts. Always develop within an application scope.

Creating Your First Custom Application: A Practical Example – Employee Onboarding App

Let’s walk through building a simplified Employee Onboarding application. This app will manage the process of onboarding new employees, ensuring they have the necessary resources and access.

Step 1: Create a New Application

  1. In ServiceNow, navigate to System Applications > Application.
  2. Click Create Application.
  3. Provide the following details:
    • Name: Employee Onboarding
    • Description: Manages the onboarding process for new employees.
    • Scope: Choose a unique scope name (e.g., x_custom_employee_onboarding).
  4. Click Create.

Step 2: Create the “Onboarding Task” Table

  1. Within your newly created application, navigate to Data Model > Tables.
  2. Click New.
  3. Provide the following details:
    • Label: Onboarding Task
    • Name: x_custom_employee_onboarding_onboarding_task (This will be automatically generated based on your scope and label).
    • Extends table: Task (This inherits common task fields like Assigned to, State, etc.)
  4. Click Submit.
  5. Add the following custom fields:
    • New Hire: Reference field to the User table (Label: New Hire, Name: u_new_hire, Type: Reference, Reference Table: User)
    • Start Date: Date field (Label: Start Date, Name: u_start_date, Type: Date)
    • Required Training: String field (Label: Required Training, Name: u_required_training, Type: String)

Step 3: Create the Onboarding Task Form

The form will automatically be created based on the fields you defined in the table. You can customize the layout of the form by navigating to the table record, then clicking “Configure > Form Layout.” Drag and drop the fields to arrange them as desired.

Step 4: Create a Workflow to Automate Onboarding Tasks

Let’s create a simple workflow that triggers when a new Onboarding Task record is created. This workflow will automatically assign the task to the appropriate HR representative.

  1. Navigate to Workflow > Workflow Editor.
  2. Click New Workflow.
  3. Provide the following details:
    • Name: Onboarding Task Workflow
    • Table: Onboarding Task (x_custom_employee_onboarding_onboarding_task)
    • If condition matches: When to run > record is created
  4. Click Submit.
  5. In the Workflow Editor:
    • Drag and drop a “Set Values” activity onto the canvas.
    • Configure the “Set Values” activity to set the “Assigned to” field to a specific HR representative (you’ll need to hardcode this for now, but you could make it dynamic later).
    • Connect the “Begin” activity to the “Set Values” activity, and then connect the “Set Values” activity to the “End” activity.
  6. Click Publish to activate the workflow.

Step 5: Create a Module to Access the Application

  1. In your application scope, navigate to System Definition > Application Menus.
  2. Open your application menu (‘Employee Onboarding’).
  3. Create a new module:
    • Title: Onboarding Tasks
    • Link Type: List of Records
    • Table: Onboarding Task (x_custom_employee_onboarding_onboarding_task)
  4. Save the module.

Now, you should be able to access your “Employee Onboarding” application and create new “Onboarding Task” records. The workflow will automatically assign these tasks to the specified HR representative.

Example Real-Life Scenario: Automating Hardware Provisioning

Imagine a company with hundreds of new hires each month. Manually provisioning hardware (laptops, monitors, etc.) for each employee is time-consuming and prone to errors. A custom ServiceNow application can automate this process:

  • Table: “Hardware Request” (fields: Employee, Hardware Type, Software Requirements, Approval Status)
  • Form: Allows managers to submit hardware requests for their new hires.
  • Workflow:
    1. Request is submitted.
    2. Approval is routed to the IT manager.
    3. Upon approval, a task is created for the IT department to provision the hardware.
    4. Once provisioned, the hardware is shipped to the employee.
    5. Notification is sent to the employee with tracking information.

This automation significantly reduces manual effort, ensures consistency, and improves the new hire experience.

Diagram: Hardware Provisioning Workflow

Best Practices for ServiceNow Application Development

  • Use Application Scoping: As mentioned earlier, application scoping is paramount.
  • Follow Naming Conventions: Consistent naming conventions make your code easier to understand and maintain.
  • Write Clear and Concise Code: Use comments to explain complex logic.
  • Test Thoroughly: Test your application in a non-production environment before deploying it to production.
  • Use Source Control: Use Git or another source control system to track changes and collaborate effectively.
  • Document Your Application: Create documentation that explains how your application works and how to use it.

Advanced Topics

Once you’re comfortable with the basics, you can explore more advanced topics:

  • ServiceNow Integration Hub: Integrate with external systems using pre-built connectors or create your own.
  • Service Portal: Build custom user interfaces for your applications that are accessible from any device.
  • Flow Designer: A low-code alternative to workflows, offering a more visual and intuitive way to automate processes.
  • REST APIs: Expose your application’s functionality through REST APIs, allowing other applications to integrate with it.
  • Automated Test Framework (ATF): Create automated tests to ensure the quality and reliability of your applications.

Resources

Conclusion

Building custom applications in ServiceNow empowers you to extend the platform’s capabilities and tailor it to your specific business needs. By understanding the core concepts, following best practices, and continuously learning, you can transform from a novice to a ServiceNow custom app hero. Start with simple projects, experiment with different features, and leverage the wealth of resources available online. The power to automate and improve your business processes is at your fingertips.

Last updated on