Вы находитесь на странице: 1из 43

Applications

PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information.
PDF generated at: Sun, 03 Aug 2014 10:08:44 PST

Building Applications
App Creator
Overview
Applications represent packaged solutions for delivering services and managing business processes. ServiceNow
includes several standard applications, such as Incident and Problem. Administrators can also develop custom
applications to meet business needs.
The app creator provides these features for building and managing custom applications:
Allows you to associate configuration recordssuch as tables, business rules, client scripts, or UI pageswith an
application.
Associates records with an application and detects cross-application conflicts as you develop.
Provides a dedicated place for creating, modifying, and publishing applications.
By building applications on the ServiceNow platform, you can take advantage of features and servicessuch as
security, workflow, reporting, and notificationsand existing datasuch as users and locations. For example,
manage conference room bookings.
The app creator is available starting with the Calgary release.

Custom Application Development


Follow this basic process to use the app creator:
1. Define the business requirements. Determine the problem you want to solve and how the application meets that
need. Answer the questions:
What does the application need to do?
Who will use it?
How will you know if it works?
2. Define the data model. Identify general categories of information you need to track.
What data is being captured?
What tables are required and how will they reference each other?
What changes do you anticipate later and does your data model scale to meet these changes?
3. Create the application.
1.
2.
3.
4.

Create an application record.


Build the data model.
Design the user interface, such as the list and form layout.
Add business logic and automation, such as business rules, UI policies, notifications, and workflows, to meet
your business requirements.
4. Test the application. Locate the application in the navigator and make sure it works as you expect. Engage users
early in your testing process. Document their feedback and make sure they are satisfied before moving to the next
step.
5. Publish the application. When it passes testing, publish the application. You can now transfer it to another
instance as an update set.

App Creator

Example Video
This video demonstrates how to create a visitor registration application. To see the example application, visit the
ServiceNow Demo [1].

App Creator Tables


These tables provide the infrastructure for building and managing applications with the app creator.
Application [sys_app]: contains the definition for each application.
Application File [sys_app_file]: contains metadata for the records that define an application.
Application File Types [sys_app_file_type]: defines which tables contain configuration records and the
relationships between them.

Application Table
The Applications [sys_app] table provides a framework for developing applications. Each record in the Applications
table contains the definition for an application, similar to the system dictionary record for a table or column.
Application developers build packaged solutions by associating configuration records, such as tables, roles, menus,
or business rules, with an application record. Configuration records are associated with an application through
application files.
See Creating a Custom Application.

Application File Table


The Application File [sys_app_file]
table contains a record for every
configuration record on an instance.
Application file records store metadata
for configuration records, such as
assigned application, parent record,
and protection policy
See Application Files.

Application record

App Creator

Application File Type


Table
The
Application
File
Types
[sys_app_file_type]
table
defines
which tables contain configuration
records
and
the
parent-child
relationships between them. For
example:

Application file record

A business rule has a parent table


(the table it references).
A UI policy action has a parent UI
policy and a grandparent table.
The system uses this structure to detect

conflicts between applications under development. See Resolving Conflicts.


This table provides system functionality and cannot be modified.

Related Tables
These tables are also important to understand when building applications.
Application Menus [sys_app_application]: groups modules under one name in the application navigator. See
Administering Application Menus and Modules.
Tables [sys_db_object]: contains a record for each table. See Table Administration.
Dictionary Entries [sys_dictionary]: contains additional details for each table and the definition for every
column on each table. Each row represents either a table or a column on a table. See System Dictionary.
Field Labels [sys_documentation]: contains the human-readable labels and language information. See Field
Labels.

How the App Creator Works with Update Sets


The app creator and update sets both provide support for developing customizations, but in different ways. Each
configuration record, such as a business rule, has a single application file record, but it may have multiple updates.
Applications group configuration records in their current state where update sets group configuration records at a
specific version. For example, compare the differences in this scenario.
1.
2.
3.
4.

Select an update set and an application.


Make a change to a tracked object, such as a business rule.
Select a different update set and a different application.
Make another change to the same business rule.
Update sets: the same business rule is listed in both update sets, with a different version in each.
Update sets track discrete changes to application files, and you can create one or more update sets to track
changes for different tasks or multiple applications at once. For example, you can package small changes and
fixes to several applications into one update set. You can also compare versions or revert to earlier versions of
a configuration record.
Applications: the application file for the business rule is assigned to the original application only.

App Creator

Application files are not moved automatically between applications, and an application file can only exist in
one application at a time. You can manually move the application file, if necessary. You can publish an
application to create an update set with only the most recent version.
For custom application development, use the app creator to develop the application and update sets to deploy it.
1. Create an application record. (App creator)
2. Assign application files to it as you develop. (App creator)
3. When development is complete, publish the current version of each record to an update set. (App creator to
update sets)
4. Transfer the application to another instance with the update set. (Update sets)

ServiceNow Applications
ServiceNow provides several standard and optional applications that are installed by plugins. An application record
exists for every active plugin on an instance (starting with the Dublin release).
Every application file installed with a plugin is automatically assigned to the corresponding application.
You cannot add application files to a ServiceNow application.
ServiceNow applications are not available in the application picker or the Move to application dialog.
Some ServiceNow applications are installed by plugins and system directories that do not appear on the list of
plugins. For example, a plugin that is available only by request.
To view a list of the trackable ServiceNow applications that are activated on the instance, navigate to System
Applications > ServiceNow Applications. You can use the following fields to filter for ServiceNow applications.
Field

Description

Vendor

[Read-only] Lists the vendor that created the application. The value is ServiceNow if the application was installed by a plugin. The field
is empty for custom applications.

Code

[Read-only] Stores the plugin ID for an application that was installed by a plugin. The field is empty for custom applications.

Trackable Indicates whether a ServiceNow application is tracked for licensing and analytics. The Usage Analytics feature provides data collection,
auditing, and reporting for trackable ServiceNow applications and all custom applications.
In the Dublin release, the field label is Licensable.

Note: These fields are not available on the application form or list by default. You can personalize the form or list layout to add
them, if desired.

Menus and Modules


Use these modules to access common features for building and managing custom applications.
Under the System Applications menu:

Create Application: creates a new application record. See Creating Applications.


Custom Applications: lists custom applications on the instance.
ServiceNow Applications: lists the licensable ServiceNow applications that are activated on the
instance (starting with the Dublin release).
Application Files: lists all application files on the instance.
Deleted Application Files: lists all application files for which the related record is deleted.
Restore Application Files: lists the application files of deleted records that you can restore (starting
with the Dublin release). See Restoring Deleted Records.

App Creator

5
Under the System Definition menu:

Application Menus: lists active menus on the instance (inactive menus are filtered by default). See
Administering Application Menus and Modules.
Menu Categories: lists categories for defining the appearance of application menu labels. See
Modifying Menu Categories.
Dictionary: lists dictionary entries for all tables and columns on the instance. See System Dictionary.
Tables: lists all of the tables on the instance (text search index tables are filtered by default). See
Creating Tables.
Fix Scripts: lists code that you run after an application is installed or upgraded. See Fix Scripts.

Enhancements
Eureka
Stores a user-defined version number for use when creating and publishing applications.
For the Application table, changes the field label from Licensable to Trackable.

Dublin
An application record exists for every active plugin on an instance. Every application file record installed with a
plugin is automatically assigned to the corresponding application.
The app creator includes choice list options as part of an application through records in the Choice Set table,
which have an associated application file. This feature allows you to add field choices to an application when the
table exists in another application (for example, choices for a field on the Incident table). See Customizing Choice
Lists.
Administrators can now add homepages and content pages to an application.
Administrators can restore deleted applications, tables, and fields along with all descendant records by clicking a
related link on the deleted application file form.
To ensure data integrity, deleting an application does not delete a table that is extended by a table in another
application.
The Restore Application Files module lists the application files of deleted records that you can restore.
The Custom Applications module replaces the Applications module.
On an application file record, the Related Record Versions and Related Record Updates related lists show the
version and update records for the related configuration record.
On an application file record, the Customer update and Replace on upgrade fields indicate whether the related
record has customer changes and whether it will be upgraded to the next software version. When you pull
versions from a parent instance, these fields are kept in sync to ensure that the same records are replaced during
software upgrades of parent and child instances. See Team Development.

References
[1] http:/ / info. servicenow. com/ DemoNow

Creating a Custom Application

Creating a Custom Application


Overview
Administrators can use the app creator to develop custom applications that meet business needs. After defining the
business requirements and the data model, create an application record and use it to help manage development
activities.
After the application is developed and tested, you are ready to transfer it to another instance. See Publishing
Applications.

Creating Applications
1. Navigate to System Applications > Create Application.
2. Define the application by completing the fields on the form (see table).
3. Click Submit. The application record remains open.
The application record is saved and now appears on the Applications list.
An application file record is created and assigned to the application. The application file appears in the All
Files related list.
The application is selected as the current application in the Application picker.
Field

Description

Name

Name that identifies the application record.

Version

String in dot-notation that identifies the application version. For example, 1.2.3. When you publish the application for transfer to
another instance, this field is passed to the update set. See Publishing Applications. This field is available starting with the Eureka
release.

Short
description

An explanation of what this application does. When you publish the application for transfer to another instance, this field is the
default description for the update set. See Publishing Applications.

Active

Indicator of whether the application is in use. The check box is selected by default, making the application active. Clear the check
box to deactivate the application.

Menu

The primary menu, which is the default application menu for any modules created in this application (see Administering Application
Menus and Modules). This value is populated automatically based on the application name. You can edit the new menu name or
select an existing menu.
Note:

User role

If the menu name does not match an existing menu, a new menu is created when you save changes to the application record.
You can modify this field for an existing application to create a new menu or select another existing menu. The default user role
is applied to the new menu. The original menu record is not changed.

The default user role required for the primary menu and to access any tables created in this application (see Creating Security Rules
for Tables). This value is populated automatically based on the application name. You can edit the new role name or select an
existing role.
Note:

If the user role does not match an existing role, a new role is created when you save changes to the application record.
You can modify this field for an existing application to create a new role or select another existing role. The role is applied to the
primary menu. The original role is not changed.

Creating a Custom Application

Defining Tables for


Applications
Build the data model you designed for
the application by creating custom
tables.
1. Navigate to System Applications
> Custom Applications.
2. Open the application record.
3. Scroll to the Tables related list.
4. [Optional] Create a table by editing
the list.
When you create a table with the
list editor, a new list module is
Application record
automatically created for it. The
module appears in the application navigator under the primary menu for the application. If the primary menu is
not defined, then a new menu is created with the table label as the name.
5. Open a table record or click New to create a new table.
6. Define the table and columns by completing the form. See Creating a Custom Table.
Note: If you create a new table with the same name as a deleted table, the new table is associated with the application of the deleted
table instead of the current application. To avoid conflicts, use a unique name for each table. You can still use the same label.

Activating and Deactivating Applications


To activate an application:
1. Navigate to System Applications > Custom Applications.
2. Click All in the breadcrumbs to remove the default active = true filter condition and display both active and
inactive applications.
3. Open the application record.
4. Select the Active check box and click Update.
All associated menus, modules, and ACLs are set as active.
You can selectively deactivate application menus, modules, and ACLs after you activate the application.
To deactivate an application:
1. Navigate to System Applications > Custom Applications.
2. Open the application record.
3. Clear the Active check box and click Update.
All associated menus, modules, and ACLs are set as inactive.
Users cannot access the application tables from the application navigator or by navigating directly to the table.
You can create new menus, modules, and ACLs for this application, but you cannot set them as active.

Creating a Custom Application

Working on Applications
Select the current application to associate configuration records with it as you develop.
1. Select the desired application in the Application picker. When you create a new application, it is automatically
selected as the current application.
2. Create a new or make a change to
an existing configuration record.
For a new record, the application
file is automatically assigned to
the selected application. If a
conflict is detected, a notification

Applications picker

appears.
For an existing record, the application file is not assigned or moved to the selected application. If the record is
not already associated with the selected application, a conflict notification appears.
3. If a conflict notification appears, resolve the conflict.

Resolving Conflicts
A conflict may exist when application files that normally belong together are not assigned to the same application. A
notification appears when the application file you changed or its parent is not assigned to the application selected in
the Application picker. For example, a conflict is detected in this scenario.
Table A is associated with Application A.
Application B is selected in the Application picker.
You create a new field on Table A.
To resolve conflicts, choose an action for each conflict that is detected.
To move the application files to the recommended application, click Move Files.
To leave the application files where they are, click Leave Alone.

Moving Application Files


to Applications Manually
The most efficient way to build
applications is to select an application
in the Application picker so that new
Resolve each conflict
application files are automatically
assigned to it and you are notified of
potential conflicts. However, you can manually assign application files to applications by:
Moving an application file with all of its descendant records (recommended). For example, when you move a UI
policy, also move its UI policy actions. Similarly, when you move a table, also move all the fields and labels on
the table.
Moving a single application file without affecting its descendants. Use this method with caution; if you move an
application file without its descendants, items may be missing when you publish the application.
Move files manually to assign unchanged application files to an application or to move application files from one
application to another.
To move an application file with all of its descendant records (recommended):
1. Navigate to the record in a list or form view (for example, System Definition > UI Policies).

Creating a Custom Application

2. For a list, select the check box beside each appropriate row, and then select Move to Application in the Actions
choice list.
3. For a form, right-click the header and select Move To Application.
4. Select an application from the list. The list defaults to the last application you selected.
5. Click Add.
The application file and all of its
descendant records are moved to
the selected application.
To move a single application file
without affecting its descendants (use
with caution):
1. Navigate to the record.
2. Right-click the header and select
Show Application File.
Move application files to an application

3. In the Application field, select the


desired application.

4. Click Update.

Adding Homepages and


Content Pages to
Applications
Homepages and content pages are not
added automatically to update sets and
applications. To manually add a page:
1. Navigate to Homepage Admin (or
Content Management) > Pages.
2. Right-click a homepage or content
page record.
3. Select Unload Portal Page.
Update the application file record

The page is added to the current


application (starting with the

Dublin release) and to the current update set.

Creating Update Sets


Use this shortcut to create an empty update set while you are working
on applications. You can use the update set to capture any changes; it
is not specific to the application. To create an update set that contains
the current version of each record in the application, see Publishing
Applications.
1. Open the application record.
2. Click the Create New Update Set related link.
Add the homepage or content page to the
current update set

3. Enter a name for the update set.

Creating a Custom Application

10

4. [Optional] Make this the current update set by selecting the check box.
5. Click Create.

Deleting Applications
By default, deleting an application also
deletes all the records that are
associated with the application, such as
tables, business rules, and menus.
Alternatively, you can deactivate an
application that is no longer in use.
Create a new update set

To delete an application:
1. [Recommended] Back up the

application in an update set. See Publishing Applications.


2. Navigate to System Applications > Custom Applications.
3. Open the application record.
4. Click Delete. A confirmation dialog box indicates the number of application files in the application to be deleted.
5. [Optional] Click Show files to
cancel deletion and navigate to a list
of the application files in the
application.
6. [Optional] Clear the check box to
delete only the application record
and not the rest of the records.
7. Click OK.
Confirm deletion

8. In the confirmation dialog, enter


delete and click OK.

The application record is deleted.


If you selected the check box in step 6, all records associated with the application files are deleted. However, a
table is not deleted if a table in another application extends it (starting with the Dublin release).
To view a list of application files
for deleted records, click the
Show Deleted Files link. You
may be able to restore some of
the deleted records.
To review the application file,
click the Show Application File
link (starting with the Dublin
release). You may be able to
restore the application and
associated records.

Application is deleted

Creating a Custom Application

11

Restoring Deleted Records


In some cases, you can restore deleted configuration records. Restoring deleted records changed starting with the
Dublin release. If you are using an older version, see previous version information.
Limitations for restoring records include:
You cannot restore a record if its parent record is deleted. For example, you cannot restore a field on a deleted
table. You must restore the parent record first.
You cannot restore a table if it extends a deleted table.
When a record is deleted, the application file stores a reference to the current record version. You can only restore
records when this reference and version record exist.
To restore an application that you just deleted:
1. On the deleted application confirmation page, click the Show Application File link.
2. Under Related Links, click Restore Deleted Application.
The application and all records
that were deleted with the
application are restored.
To restore an older application or
another configuration record:
1. Navigate to System Applications
> Restore Application Files.
2. Locate the application file by
filtering on the source table of the
configuration record. For example:
For an application, filter on
Source Table is Application
and look for the application
name.
Restore all application records

For a table, filter on Source


Table is Table and look for the
table name.

For a field, filter on Source Table is Dictionary Entry and look for the field name.
3. Open the application file.
4. Under Related Links, click the link to restore the record.
The record is restored.
If the record is an application, table, or field, all descendant records that were deleted with it are restored. For
example, restoring an application also restores all records that were deleted with the application. Restoring a
table also restores all the fields and labels that were deleted with the table.

Restoring Deleted Records Prior to the Dublin Release

Creating a Custom Application

Click the plus to expand previous version information


In some cases, you can restore deleted configuration records. Limitations include:

You cannot restore individual fields or field labels. You can only restore a deleted table, which restores any fields and labels that were deleted
with it.
You can only restore records where both the update and version records exist. For example, you cannot restore a record if you also deleted the
update record (see Deleting Update Entries).

To restore an application that you just deleted:


1. On the deleted application confirmation page, click the Show Deleted Files link.
2. Select all of the rows.

Restore all application records


3. Select Restore Deleted Record in the action choice list.
The application and all associated records are restored.
To restore an older application:
1.
2.
3.
4.
5.
6.
7.

Navigate to System Applications > Deleted Application Files.


Locate the application file by filtering on Source Table is Application and looking for the application name.
Select the check box beside the application file.
Select Restore Deleted Record in the action choice list.
Filter the list of deleted application files again on Application is <the application name>.
Select all of the records.
Select Restore Deleted Record in the action choice list.

To restore a table:
1.
2.
3.
4.

Navigate to System Applications > Deleted Application Files.


Locate the table application file by filtering on Source Table is Table and looking for the table name.
Select the check box beside the table application file.
Select Restore Deleted Record in the action choice list.
The table and all the fields and labels that were deleted with it are restored.

12

Creating a Custom Table

13

Creating a Custom Table


Overview
Administrators can create custom tables as well as application menus, modules, and security rules that allow users to
work with data in the tables. Administrators can also create service catalog record producers directly from a table
record. Creating tables is a core part of creating an application (see Creating a Custom Application).

Creating Tables
1.
2.
3.
4.
5.

Navigate to System Definition > Tables.


Click New.
Define the table by completing the fields on the form (see table).
Use the Table Columns embedded list to add columns to the table.
Click Submit to create the table, or click Cancel to close the Table form without creating a new table.
Field

Description

Label

Enter a unique label for the table. The label appears on list and form views for the table. Updating the Label field also updates
the label record in the language file (for the current language). See Field Labels.

Name

[Optional] Edit the table name, which is automatically populated based on the table label. You can use lowercase, alphanumeric
ASCII characters and underscores (_) in the table name. The table name is prefixed with u_ to indicate that it is a custom table.
You cannot modify this prefix.
For example, if you enter Marketing Event as the table label, the table name defaults to u_marketing_event.

Extensible

Select the check box to allow other tables to extend this table. Clear the check box to prevent the creation of additional child
tables; existing child tables remain unchanged.

Extends Table

[Optional] Select the table to extend. Extending a base table incorporates all of the fields of the original table and creates new
fields for the new table. Only tables that are marked as extensible appear in this list.
This option is available only when you are creating a table.

Create module

[Optional] Select the check box and then complete the Add module to menu field to create a list module in the application
menu.
This option is available only when you are creating a table.

Add module to
menu

Select an existing menu or select Create new and enter a new menu name. This option is available only when the Create
module check box is selected.

Create access
controls

[Optional] Select the check box and then complete the User role field to create basic security rules for the table.

User role

Enter a new name or select an existing user role that is required to access this table. This option is available only when the
Create access controls check box is selected.

Live feed

[Optional] Select the check box to enable document feeds for the table (starting with the Dublin release). This option adds the
Show Live Feed button (
) in the form header.

Auto-number

[Optional] Select the check box, and then define the number format to add an auto-numbered field to the table. The check box is
available only when a number format does not exist for the table. Otherwise, you can edit the existing number format.

Creating a Custom Table

14

Adding Columns
You can add database columns (fields)
when creating a new table or when
editing an existing table. To learn more
about creating fields, see Creating New
Fields.
To add columns from the table record:
1. Navigate to System Definition >
Tables.

Requests table

2. Create a new table or open an


existing table record.
3. In the Table Columns embedded
list, double-click Insert a new row.

4. Define the column by completing the fields in the row (see table).
[Existing tables only] You can create a column with advanced settings by right-clicking the form header and
selecting Create Advanced Column. See Modifying Dictionary Entries.
The Table Columns embedded list provides list filtering, searching, and sorting in addition to standard
embedded list functions.
5. Repeat steps 34 for each column being added.
To delete a field, click the red X beside the row. This option is available only for custom fields.
To save column changes, save the form. See Using Embedded Lists.
6. Click Submit or Update.
7. [Optional] To customize the form layout for the new fields, open the table record, click the Personalize Form
related link, and then personalize the form.
New fields are automatically added to the default form view. If a default form view already exists, new fields
are added at the end of the first section.
In versions prior to the Dublin release, open the table record, click the Show New Record Form related link,
and personalize the form.
8. [Optional] To customize the list layout for the new fields, open the table record, click the Personalize List
related link, and then personalize the list.
In versions prior to the Dublin release, open the table record, click the Show Records in List related link, and
personalize the list layout.

Creating a Custom Table

15

Field

Description

Column
label

Defines a unique label for the column. The label appears on list headers and form fields for the column.

Type

[Mandatory] Defines the field type for the column. See Introduction to Fields. To preserve existing data, only change fields between
the same basic type (for example, Choice and String). A warning appears if a change to a custom field will result in data loss. For a
base system field, you cannot make a change that will result in data loss.

Reference

Makes the field into a reference field.

Updating the Column label field also updates the label in the language file (for the current language). See Field Labels.
When you create a new column, the column name is populated automatically based on the label. The name is automatically
prefixed with u_ to indicate that it is custom. For example, if you enter Activity Description as the column label, the column name
defaults to u_activity_description.

Note: Dynamic reference creation is enabled for this field. So, if you enter a table name that does not match an existing table, a new
table is created when you save your changes to the current table record. If the current table has a module in the application navigator,
then a module for the newly created table is automatically created in the same application menu.
Max
length

[String fields only] Limits the length of the field. A length of under 254 appears as a single-line text field. Anything 255 characters or
over appears as a multi-line text box.
Note:

You can change this value only for a String field. Changes for any other type of field are ignored.
Users on an Oracle instance cannot increase the maximum length of a string field to anything greater than 4000 through the
application UI as this requires the CLOB datatype in Oracle. To increase beyond this size, log an incident with Technical Support
to request the change.
To prevent data from being lost, only decrease the length of a string field when you are developing a new application and not when
a field contains data. A warning appears if a change to a custom field will result in data loss. For a base system field, you cannot
make a change that will result in data loss.

Default
value

Specifies the default value of the field for any new record. Ensure that this value uses the correct field type. For example, an integer
field can use a default value of 2 but cannot use a default value of two. These values can be overridden with dictionary overrides.

Display

Indicates that this field is the display value for reference fields (appears on records that reference this table).
Note: This option does not control whether or not this field is displayed on lists or forms.

Global Default Fields


When you create a new custom table, several fields appear in the Table Columns embedded list. For all tables,
required system fields are added automatically. You cannot delete or modify these fields.
For tables that extend another table, fields on the parent table also appear on the Table Columns embedded list for
the current table. If you modify these fields, remember that all changes to fields on the parent table also affect all
child tables, not just the current table.
These required system fields are added to all tables:
Field

Type

Description

Class [sys_class_name]

System Class Name If the table is extensible, a string field that indicates which child table contains the record.

Created [sys_created_on]

Date/Time

A time-stamp field that indicates when a record was created.

Created by [sys_created_by]

String

A string field that indicates the user who created the record.

Sys_id [sys_id]

Sys ID

The unique record identifier for the record.

Updates [sys_mod_count]

Integer

A numeric field that counts the number of updates for this record since record creation.

Updated by [sys_updated_by] String

A string field that indicates the user who most recently updated the record.

Updated [sys_updated]

A time-stamp field that indicates the date and time of the most recent update.

Date/Time

Creating a Custom Table

16

Creating Modules for Tables


Modules allow users to access the table from the application navigator. To learn more about modules, see Creating
Modules. To learn about mobile device modules for instances that use the smartphone interface, see Defining
Smartphone Application Menus and Modules.
When you are creating a table, you can quickly create a default module for the standard browser and the mobile UI.
1. Select the Create module check box. The Add module to menu field appears.
2. Select an existing menu or select Create new and enter a new menu name.
If you are working on an application, the primary menu is selected by default.
If you are not working on an application, Create new is selected and the menu name defaults to the table label.
3. Define the table and save the record.
A new module is created with the following values:

Table: current table


Title: plural of the table label
Link type: List of Records
Application menu: selected menu
Device type: Any (starting with the Dublin release for instances that do not use the smartphone interface)

If you selected Create new in step 2, a new application menu is created. The Default device type is set to Any
(starting with the Dublin release for instances that do not use the smartphone interface).
For instances that use the smartphone interface, a new mobile module and a new mobile application menu are
created.
To create additional modules (for
example, a filtered list view):
1. Navigate to System Definition >
Tables and open the Table form.
2. Scroll down to the Modules related
list, and click New.

Create a default module

3. Define the module by completing


the Module form. See Creating a
Module.
The Table field defaults to the

current table and the Link type defaults to List of Records.


The Device type field defaults to Any (starting with the Dublin release for instances that do not use the
smartphone interface).
You must enter the Application menu and Title.
To create additional modules for the mobile UI (for instances that use the smartphone interface only):
1. Navigate to System Definition > Tables and open the Table form.
2. Scroll down to the Mobile Modules related list, and click New.
3. Define the module by completing the Module form. See Defining Smartphone Application Menus and Modules.
The Table field defaults to the current table.
You must enter the Application menu and other module information.

Creating a Custom Table

17

Adding Record Numbering


You can quickly create a number field and define the number format for records on the table. To learn about
additional numbering options, see Managing Record Numbering.
To add record numbering to a table that does not have a number format defined:
1. Navigate to System Definition > Tables.
2. Create a new table or open an existing table record.
3. Select the Auto-number check box. The number format fields appear on the form.
Note: The check box is available only when a number format has not yet been defined. You can define only
one number format per table.
4. [Optional] Modify the number
format by updating the fields (see
table).
5. Click Submit.
The number format is
automatically created for the
table.
Add record numbering
If an auto-numbered field does
not already exist, a new field is automatically created on the table with the following values:
Label: Number
Name: u_number
Default value: javascript:getNextObjNumberPadded();
Field

Description

Prefix

Enter a prefix for every number in the table (for example, INC for Incident). The default value is the first three letters of the table
label.

Number

Enter the base number for this table (default value is 1000). Record numbers are automatically incremented, and the next number is
maintained in the Counter [sys_number_counter] table.
If you set the base number to a value higher than the current counter, the next record number uses the new base number. Otherwise
the next record number uses the current counter. The counter does not reset to a base number lower than itself.

Number of
digits

Enter the minimum number of digits to use after the prefix (default value is 7).

Leading zeros are added to auto-numbers, if necessary. For example, INC0001001 contains three leading zeros.
The number of digits can exceed the minimum length. For example, if Number of digits is 2 and more than 99 records are
created on the table, the numbers continue past 100 (such as INC101).

Warning: Changing this field may update all number values for existing records on a table. Take care when changing this field on a
production instance. See Renumbering Records.

Note: To change the default values for new number formats, change the Default value field on the system dictionary record for the
Number or Number of digits field. These fields are on the Number table.

Creating a Custom Table

18

Removing Record Numbering


To remove record numbering from a table, delete the number format and the auto-numbered field.
1.
2.
3.
4.
5.
6.

Navigate to System Definition > Number Maintenance.


Click a table name to open the number record for that table.
Click Delete.
Navigate to System Definition > Tables and open the Table form.
Click the red X beside the auto-numbered field.
Click Update.

Creating Security Rules for Tables


You can quickly create basic security rules for a table. To learn more about security rules, see Using Access Control
Rules.
To create security rules from the table record:
1. Navigate to System Definition > Tables.
2. Create a new table or open an existing table record.
3. Select the Create access controls check box. The User role field appears on the form.
4. Enter a new name or select an existing user role that is required to access the table.
If you are working on an application or a table that is part of an application, the default user role for the
application is automatically populated. Otherwise, the field is automatically populated based on the table label.
5. Click Submit or Update.

Add table security

If the user role does not match an


existing role, a new role is
created.
Security rules are created that
grant the user role full access to
the tableread, write, create,
and delete.

6. [Optional] Scroll down to the Access Controls related list to create new or modify existing access control list
(ACL) rules.
Note: You can repeat the procedure to grant full access to a different role. The new role is created and the original role is replaced
for every ACL on the table. The original role is not changed for ACLs on other tables or objects, and any other roles or scripts on the
ACLs are not changed.

Extending a Table
You can create a new table that stands alone or that extends a base table. Extending a base table incorporates all of
the fields of the original table and creates new fields for the new table. This inheritance is used to create
subcategories of data. Examples include the Incident, Problem, and Change tables, which are all subcategories of the
Task table.
To extend a table, select the table to extend in the Extends Table field on the table record. This option is available
only when you are creating a table.

Creating a Custom Table

19

Note: For a table that extends another table, the Table Columns embedded list shows columns on both the child table and the table it
extends. To improve sorting and filtering, consider personalizing the list to add the Table field. You cannot change the table for a
field. You can add columns only to the current table.

To make a table extensible:


1. Navigate to System Definition >
Tables.
2. Click the table that you want to
extend.
3. Select the Extensible check box.
The table is now available in the
Extends Table field.
Personalize Table Columns list to sort fields by Incident or Task

Note: You cannot extend system tables (such as sys_audit) or database view tables.

Example: Enabling Workflows for Tables that Extend Task


To create a table of task records, similar to the Incident, Problem, or Change table, create a new table that extends
the Task table. To allow workflows to operate on the table:
1. Navigate to System Definition > Tables and open the new table record.
2. Right-click the form header and select Show Dictionary Record.
In versions prior to the Dublin release, click the Show Dictionary Record related link.
3. Add the following to the attribute:
hasWorkflow

The new table now has fields from the Task table and supports workflows.

Example: Creating a New CMDB Class


Each CMDB class is its own table, so creating new classes requires creating new tables.
To create a new class (such as Laptops or Thin Clients):
1. Create a new table (see following table for specific values).
2. [Optional] If you want other CMDB classes to extend the new one, select the Extensible check box. You can also
select this field after the table is created.
3. Use the Table Columns embedded list to add any class-specific columns. For example, the following image
shows a way to create a new CMDB class for laptops.

Creating a Custom Table

20
4. Click Submit.
5. Add any related lists. Refer to the
existing classes (such as
Workstations) for examples.
6. Position the new module in the
correct location in the application
navigator.
In the Laptops example, the
new class belongs next to the
Workstations module, under the
Base Items heading.

Example: CMDB class for laptops

1. Right-click Configuration in
the application navigator and select Edit Application.
2. Locate the Workstations module in the list and note the value in the Order column.
3. Open the new Laptops module and give it an order value one number greater or less than the order number
of the Workstations module.
4. Click Update.
Field

Description

Label

Enter the name of the new class (such as Laptops or Thin Clients).

Name

Preface the name of the table with u_cmdb_ci_ to make it similar to the other CMDB classes (for example, u_cmdb_ci_laptop).

Extensible

Select the check box to allow other tables to extend this table.

Extends Table

Select the parent table for the new class. For example, if the new class is Laptops, which is a subclass of Computers, select the
cmdb_ci_computer table. If the new class is a top-level class, select the cmdb_ci table.

Add module to
menu

Select the check box and then select the Configuration application to create a list module for the new class in the same
application with the other classes.

Creating Record Producers for Tables


To save time, you can create service catalog record producers directly from a table record (starting with the Dublin
release). In versions prior to Dublin, you can only create record producers in the service catalog.
To create a record producer from a table record:
1.
2.
3.
4.

Navigate to System Definition > Tables and open the table record.
Under Related Links, click Add to Service Catalog.
Complete the Name, Short Description, and Category fields as you would for service catalog items.
Use the slushbucket to select the fields and the order in which you want them to appear. To use container
variables, select |- container start -| and |- container start -|.

Creating a Custom Table

21
5. Click Save and Open to open the
record producer and define
additional options. Alternatively,
click Save to return to the table
record.
A record producer is created
with these values:
Table name: table record
opened in step 1
Name, Short Description,
and Category: information
entered in step 3

Record producer

A variable is created for each of


the selected fields with these
values:
Name: Column name of the

field
Type: variable type that corresponds to the field type
Order: position selected in the slushbucket (for example, 100 for the first field and 200 for the second
field)
Question: Column label of the field
If the field type is Choice, a corresponding question choice is created for each field choice.
The new record producer is added to the Record Producers related list on the table record.

Application Files

22

Application Files
Overview
Application files associate configuration records with an application and contain metadata for the records.
Administrators use application file records to:

See application-related attributes.


See parent-child relationships between configuration records.
Assign records to an application. See Moving Application Files to Applications Manually.
Restore deleted configuration records. See Restoring Deleted Records.

This feature is available with the Calgary release.

Application File Records


For every configuration record, the Application File [sys_app_file] table contains a record that defines application
attributes (see table). The Application File Types [sys_app_file_type] table defines which tables contain
configuration records (such as tables, business rules, client scripts, or UI pages).
Configuration records are also tracked by update sets, which allow you to transfer the application to another instance.
When an application file record or its related record is changed, a corresponding record is added in the Customer
Updates [sys_update_xml] table. The application file record is tracked and transferred along with the customized
record in a single update record, ensuring that a record and its application file are kept in sync when transferring
applications between instances.
Application files are not created explicitly. Whenever a configuration record is created or modified, its associated
application file is automatically created or modified. An application file is programmatically kept in sync with the
record it describes, and most configuration tables do not have a direct reference to the application file table. By
default, only Applications [sys_app] and Tables [sys_db_object] have an explicit reference field to the Application
File [sys_app_file] table.
Field

Description

Name

Display name for the related configuration record.

Related record

Reference to the configuration record.

Parent file

Reference to the parent application file, if one exists.

Application

Application that contains the application file.

Protection
policy

Policy preventing customization of certain base system code.

Created

Creation date of the related record.

Created by

User who created the related record.


Additional fields on the list view:

Source Table

Table containing the related record.

Updated

Last update date for the application file or related record.

Updated by

User who last updated the application file or related record.


Fields that can be added by personalizing the form:

Application Files

23

Replace on
upgrade

Flag that indicates whether the related record will be upgraded to the next software version (starting with the Dublin release). The
value is automatically set to false when you change non-excluded fields on the related record. To overwrite changes during the
next software upgrade, change the value to true. See Overwriting Customizations During Upgrades.

Customer
update

Flag that indicates whether the related record has customer changes (starting with the Dublin release). The value is automatically
set to true when you change any field on the related record.
Related lists on the form view:

Related Record
Versions

Version records for the related configuration record (starting with the Dublin release). A version record is every time a user
changes the related record. Use this list to compare versions of the configuration record or to revert to a previous version. See
Versions.

Related Record
Updates

Local update records for the related configuration record (starting with the Dublin release). An update record is created for the
most recent change to the related record in a given update set. See Update Sets.

Applications
An application file associates its related configuration record with an application record. Assign application files to
an application to:
Understand who owns and who changes application records and code.
Detect conflicts between applications under development.
Publish the current version of each application file to an update set when development is complete.
See Working on Applications.

Protected Application Files


Some application code shipped with ServiceNow requires special protection. When an application file has a
Read-only protection policy, nobody can modify the related record. Only a ServiceNow employee can alter the
protection policy and then modify the application file or its related record. A ServiceNow employee cannot make
any changes without changing the policy designation first.
To prevent customizations from being overwritten by system upgrades, the upgrade process automatically skips
changes to customer-updated records. If you modify an application file or related record that is later designated as
Read-only in an upgrade, the application file maintains the default protection policy of Write. You keep the existing
modifications and can continue modifying the records.

Relationships Between Application Files


In addition to defining which tables contain configuration records, the Application File Types table also defines
parent-child relationships between configuration records. The system uses this structure to keep application files that
normally belong together in the same application by:
Notifying developers when a conflict is detected between applications under development. See Resolving
Conflicts.
Moving an application file with its descendants. See Moving Application Files to Applications Manually.
Warning: The Application File Types table provides system functionality and should not be modified.

For example, consider the parent-child relationships for a UI policy.


The UI policy is a child of the table.

Application Files

24

UI policy actions are children of the UI policy.


UI policy actions have a parent UI policy and a grandparent table.
The UI policy actions and the UI policy are all descendants of the table.
From an application file record, you
can access related application files. To
navigate from an application file to its
parent, click the Show Parent File
related link.

UI Policy relationships

To see all child application files for an


application file, scroll down to the
Descendant Files related list.

Show Parent File

Navigating
Application Files and
Records
Navigate between a configuration
record and its application file by
right-clicking the form header and
selecting Show Application File.

Descendant Files

Application Files

25
Navigate between an application file
and its related record (for example, an
application menu record) by clicking
the Show Related Record related link.

Show Application File

You can also navigate between a


customer update record and the
application file or the related record.
See Navigating Updated Records.

Navigating
Application File Lists
Show Related Record

Navigating from a list of application


files to a record works differently from

most lists.
To open the application file record itself, click the reference icon beside the row.
To open the related record, click the link in the first column.
For example, use any of these
application file lists to help build and
manage applications:
Navigate to System Definition >
Application Files to see a list of all
application files on the instance.
Application files list

Example
use:
filter
all
application files by application,

type of record (source table), user who created it, or when it was last updated.
Navigate to System Definition > Deleted Application Files to see a list of all application files for which the
related record is deleted.
Example use: restore an application or table. See Restoring Deleted Records.
Open an application record and scroll down to the All Files related list to see a list of all application files
contained in the application.
Example use: run fix scripts after you transfer an application to another instance. See Running Fix Scripts.

Fix Scripts

26

Fix Scripts
Overview
A fix script is server-side JavaScript code that you run after an application is installed or upgraded. Include fix
scripts to make changes that are necessary for the data integrity or product stability of an application.
Administrators and users with the script_fix_admin role can create and run fix scripts. This feature is available with
the Calgary release.

Creating Fix Scripts


To create a fix script:
1. Navigate to System Definition > Fix Scripts.
2. Click New.
3. Define the fix script by completing the fields on the form (see table).
4. Click Submit.
5. Test the fix script and make any
necessary changes.

Fix script

Field

Description

Name

Enter a unique, descriptive name for the fix script.

Active

Select the check box to enable the fix script.

Unloadable Select the check box to create Customer Update [sys_update_xml] records when the fix script runs. Clear the check box to run
upgrades without creating these records (default).
Unloadable is enforced when you test the fix script.
Run once

Select the check box to run the script only one time (default). The fix script is ignored for subsequent upgrades.
Clear the check box allow the script to run every time the application is installed or upgraded.
This option is enforced by the following mechanism.

When a fix script is processed, a corresponding record is added to the sys_update table.
The upgrade process automatically skips fix scripts that are flagged as Run once and have an entry in the sys_update table.

Run once is not enforced when you test the fix script.

Fix Scripts

Flush
cache

27
Select the check box to require a cache flush after the application is installed or upgraded. Certain system changessuch as changes
to the dictionary, client scripts, UI policy, or system propertiesrequire a cache flush to take effect.
If the check box is selected for at least one of the fix scripts that are run, the cache is flushed when the installation or upgrade is
complete. If the check box is not selected for any of the fix scripts that are run, then the cache is not flushed.
Flush cache is enforced when you test the fix script.

Before

Select the check box to run the fix script before installing or upgrading the application. Clear the check box to run the fix script after
(default).

Description Enter a description of the fix script.


Script

Enter the code for the fix script.

Testing Fix Scripts


Warning: Do not test fix scripts on production instances. Fix scripts can add, update, and delete data, including rules, scripts,
and property settings.

1. Open the fix script record.


2. Review the code design to ensure that it can run more than once on the same system without causing damage.
Note: This review is different from the Run once option, which determines whether it is necessary to run it
more than once on the system. For example, you may write a fix script that adds a role to a property by default.
Design the script so that it can run multiple times on the same system without overwriting the existing data,
even if it is not necessary to run the script again after the initial installation.
3. Click the Run Fix Script related link.
Note: The Run once option is not enforced for tests. The Flush cache and Unloadable options are enforced.
4. Confirm how to run the script.
Click Proceed in Background to run the script in the background. Use this option for long-running scripts or
if you do not know the expected execution time.
Click Proceed to run the script in the foreground. The results are displayed in a confirmation window when the
execution is completed.
5. Review the results and make any
necessary changes.
Click Show Progress Workers to
view a list of previous test results.
You can cancel a job that is currently
running by opening the progress
worker record and clicking the Cancel
job related link.
Successful fix script test

Fix Scripts

28

Running Fix Scripts


After you transfer an application to
another instance (see Publishing
Applications), you must manually run
any necessary fix scripts.
Previous test results

1. Navigate to System Applications


> Custom Applications.

2. Open the application record.


3. Scroll down to the All Files related list.
4. Filter the list for fix scripts (Source Table is Fix Script).
5. Run each fix script and ensure that
it completes successfully.

Fix scripts included in an application

Publishing Applications

29

Publishing Applications
Overview
Administrators can publish applications that are complete and ready to transfer to another instance. For example,
publish an application to transfer and deploy it to a production system.
This feature is available with the Calgary release.

Publishing Applications
1.
2.
3.
4.

Navigate to System Applications > Custom Applications.


Open the application record.
Click the Publish to Update Set related link.
[Optional] Define additional application information by completing the fields in the dialog box (see table).
5. Click Publish.
A new update set is created and
the latest update of each
application file in the application
is copied into it. The update set
is marked as complete.
6. Transfer the update set to another
instance according to your test
process. See Transferring Update
Sets.

Publish Application dialog box

7. Run any fix scripts that are included in the application.


Field

Description

Application
name

[Read-only] Displays the name of the application that you are publishing.

Version

Enter version information to append to the update set name in dot-notation such as 1.2.3. The platform saves the information you
enter here in the application Version field (starting with the Eureka release).
The update set has the name <Application name> - <Version>. If you leave this field blank, the initial update set has the name
<Application name> and subsequent update sets have the name <Application name> - <Sequential number>.

Description

Enter a description for the update set. By default, this field contains the short description of the application.

Include data

Select the check box to include a limited number of data records from each table in the application. Use this feature to package
sample data with your applications.
Warning: Using this feature to migrate large quantities of data records between instances can cause performance issues, as it is not
intended for this purpose. To migrate data, use an instance-to-instance import. Administrators can adjust the maximum number of
data records to include with an application.
Note:

If your sample data includes tables with record numbering, the current counter value is also transferred. When the update set is
applied on another instance, the counter is set to the larger of the counter in the sample data or the counter on the target instance.
For translated fields, only records in English are transferred.

Publishing Applications

Setting Limits for Publishing Data


Administrators can limit the number of data records to include when publishing an application.
1. Enter sys_properties.list in the navigation filter.
2. Locate the com.snc.apps.publish.maxrows property.
3. Set the Value field.
To minimize performance impact, set this value to less than or equal to the default value of 1,000.
4. Click Update.

30

31

Examples
Conference Room Bookings
Overview
This example guides you through creating a simple custom application for managing conference room requests. To
learn more about the features demonstrated in this example, see Further Reading.

Audience
This guide is intended for junior ServiceNow system administrators. You should be familiar with the platform, but
you don't need much experience developing or maintaining custom tables. A basic understanding of JavaScript and
relational databases would be helpful, but is not necessary.

Create an Application Record


1. Navigate to System Applications > Create Application.
2. Define the application by completing the following fields on the form. Use the default values for the rest of the
fields.
Name: Conference room bookings
Short description: Book conference rooms
3. Click Submit. The application record remains open.
The application record is created and appears on the Applications list.
An application menu, called Conference room bookings, is created.
A user role, u_conference_room_bookings_user, is created and granted access to the Conference room
bookings application menu.
File records for the application, menu, and role are automatically created and assigned to the application
(appear in the All Files related list).
The Conference room bookings application is selected as the current application in the Application picker.

Conference Room Bookings

32

Build the Data Model


Request Table
1. On the application record, scroll
down to the Tables related list.
2. Click New.
3. Define the table by completing the
following fields on the form. Use
the default values for the rest of the
fields.
Name: Request
Auto-number: Select the check
box and use the default values
for the number format.

Application record

4. In the Table Columns embedded list, define each column (see table).
5. Click Submit.
The Request table is created with the columns you defined, an auto-numbered field, and the required system
fields.
Security rules are created to grant the u_conference_room_bookings_user role full access to the Request table.
The Room table is created with the required system fields.
A user role, u_room_user, is created. Security rules are created to grant the role full access to the Room table.
Modules for the Request and Room tables are created under the Conference room bookings application
menu.
Application file records for the tables, columns, modules, security rules, and roles are automatically assigned
to the application.
Column label

Type

Requester

Reference to User

Date and time

Date/Time

Location

Reference to Room (a table that does not yet exist)

Attendees

Integer

Duration

Integer

Conference Room Bookings

33

Room Table
1. On the application record, scroll
down to the Tables related list.
2. Open the Room table record.
3. Select the Auto-number check
box. Use the default values for the
number format.
4. In the Table Columns embedded
list, define each column (see table).
5. Click Update.
The new columns you defined
and an auto-numbered field are
Request table
created.
The Name field is set as the display column, meaning that it appears on records that reference the Room table.
The application file records for the columns are assigned to the application.
Column label

Type

Name

String. Set Display to true

Campus

Choice

Capacity

Integer

Floor

Integer

Phone number String


Polycom

True/False

Projector

True/False

WiFi

True/False

Conference Room Bookings

34

Campus Choices
Create a choice list of campuses:
1. Open the Room table record.
2. Under Related Links, click Show
Form.
In versions prior to the Dublin
release, click Show New Record
Form.
3. Right-click the Campus field label
and select Personalize Choices.
4. Create the following options:

Room table

San Diego
Seattle
Austin
Chicago
Detroit
Amsterdam
London

Tokyo
5. Click Save.

Room Data
Enter data for available conference
rooms:
1. Navigate to Conference room
bookings > Rooms.
2. Click New.
3. Enter the room details as listed in
the table.
4. Click Submit.
5. Repeat steps 1 4 for all rooms in
the table.

Campus choice list

Conference Room Bookings

35

Name

Campus

Capacity

Floor

Phone number

Polycom

Projector

WiFi

Aruba

San Diego

(858) 430-9812

true

true

false

Fiji

Austin

19

(512) 398-4531

true

true

true

Jamaica Amsterdam 27

+20 043-9086

true

true

true

Oahu

Detroit

17

(313) 490-2346

true

true

true

Tahiti

Tokyo

+31 098-04356

false

true

true

Security
1. In the banner, click the lock icon beside your user name and select the security_admin check box to elevate your
role. Click OK.
2. Navigate to Conference room bookings
> Rooms.
3. Right-click the list header and select
Personalize > Table to open the table
record.
4. In the Access Controls related list, open
the record for the read operation.

Elevate your role

5. In the Requires role related list,


click Edit.
6. Add the
u_conference_room_bookings_user
role and click Save.
7. Navigate to User Administration
> Roles.
8. Open the u_room_user record.

Read operation ACL

u_conference_room_bookings_user role and click Save.

9. In the Contains Roles related list,


click Edit.
10. Add the

Conference Room Bookings

36

Design the User Interface


List and Form Layout
Change the default list and form layout for the Request table.
1. In the banner, click the icon beside the Application picker to open the current application record.
2. In the Tables related list, open the
Request table record.
3. Under Related Links, click
Personalize List.

Show selected application

In versions prior to the Dublin


release, click Show Records in
List. Then, right-click the header
and select Personalize > List
Layout.

4. Use the slushbucket to select the columns and the order in which you want them to appear.
You can match this sample list layout.
5. Click Save.
6. Under Related Links, click
Personalize Form.

Requests list layout

In versions prior to the Dublin


release, on the Requests list,
click New. Then, right-click the

form header and select Personalize > Form Layout.


7. Use the slushbucket to select the fields and the order in which you want them to appear.
You can match this sample form layout.
8. Click Save.

Field Label
Request form layout

Change the field label for meeting


duration:
1. Navigate to Conference room

bookings > Book a conference room.


2.
3.
4.
5.

Click New.
Right-click the Duration field label and select Personalize Label.
In the Label field, enter Duration (minutes).
Click Update.

Conference Room Bookings

37

Module
Change the title and icon for the automatically created Requests module:
1.
2.
3.
4.

Navigate to Conference room bookings.


Right-click the icon beside Requests and select Edit Module.
Change the title to Book a conference room.
Change the image to select another icon.
5. Click Update.

Add Business Logic


and Automation
Request module

Populate the Requester


Automatically populate the Requester field with the current user:
1.
2.
3.
4.

Navigate to Conference room bookings > Book a conference room.


Click New.
Right-click the Requester field label and select Personalize Dictionary.
In the Default Value field, enter this code:

javascript:gs.getUserID()
5. Click Update.

Identify a Room
Help users identify a suitable room based on attendance and campus location:
1.
2.
3.
4.

Navigate to Conference room bookings > Book a conference room.


Click New.
Right-click the Location field label and select Personalize Dictionary.
In the Reference qual field, enter this code:

javascript:'u_capacity>=' + current.u_attendees
5. In the Attributes field, enter:
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=u_campus;u_capacity

Conference Room Bookings

38
6. Click Update.
7. Click the reference lookup icon (
) beside the Location field.
8. In the lookup window, right-click
the list header and select
Personalize > List Layout.

Dictionary Entry for Location

9. Add the Campus and Capacity


fields and click Save.

Send an Email
Confirmation
Email the requester to
acceptance of the request:

confirm

1. Ensure that the instance is


configured to send email. See
Configuring Email.
Personalize the reference lookup list

2. Navigate to System Policy >


Email > Notifications.

3. Click New.
4. Define the email notification by completing the fields on the form (see table). Use the default values for the rest
of the fields.
5. Click Submit.
6. Navigate to System Definition >
Tables.
7. Open the Request [u_request] table
record.
8. For the Number column, set the
Display value to true.
9. Click Update.
Email notification

Conference Room Bookings

39

Field

Value

Name

Conference room bookings

Table

Request [u_request]
When to send

Send when

Record inserted or updated

Inserted

Select the check box

Updated

Select the check box

Conditions

Location is not empty


Who will receive

Users/groups in fields Requester


What it will contain
Subject

Approved - conference room request #${u_number}

Message

Your conference room request is approved.


<ul>
<li><b>Request #:</b> ${URI_REF}</li>
<li><b>Room name:</b> ${u_location.URI_REF}</li>
<li><b>Date and time:</b> ${u_date_and_time} for ${u_duration} minutes</li>
<li><b>Campus:</b> ${u_location.u_campus}, Floor ${u_location.u_floor}</li>
<li><b>Call-in number:</b> ${u_location.u_phone_number}</li>
</ul>

Test the Application


1.
2.
3.
4.
5.
6.

Navigate to User Administration > Users and open a test user record.
Ensure the user has a valid email address.
Grant the u_conference_room_bookings_user role to the user.
Impersonate or log in as the user.
Navigate to Conference room bookings > Book a conference room.
Click New.

Notice that the Requester field is automatically populated with the user name.
7. In the Attendees field, enter 9.
8. Click the icon beside the Location field.
Notice that the list only shows rooms with a capacity greater than or equal to 9.
9. Close the window. In the Location field, begin typing J.
Notice that the auto-complete shows the name, campus, and capacity for matching rooms.
10. Select Jamaica.
11. Complete the rest of the form and click Update.
12. Run through several more scenarios to test the business logic and functionality.
13. Log back in as an administrator.
14. Navigate to System Mailboxes > Outbound > Sent. If the emails are not listed, remove the Mailbox = Sent
condition from the breadcrumbs.
15. Open an email record.
16. Under Related Links, click Preview HTML body.
Notice that email notifications were generated with the correct information.

Conference Room Bookings

40

Publish the Application


1.
2.
3.
4.
5.

Navigate to System Applications > Applications.


Open the application record.
Under Related Links, click Publish to Update Set.
Click Publish.
On the confirmation screen, click Update Set to view the update set that you can use to transfer the application to
another instance.

Further Reading
These articles contain details about the features demonstrated in this example.
Section

Suggested Wiki Links

Create an Application Record

App Creator
Creating a Custom Application

Build the Data Model

Creating a Custom Table


Customizing Choice Lists
Using Access Control Rules
Creating Roles

Design the User Interface

Personalizing Lists
Personalizing Forms
Introduction to Fields
Administering Application Menus and Modules
Module Icons

Add Business Logic and Automation

Reference Fields
Auto-Complete for Reference Fields
Reference Qualifiers
Email Notifications

Test the Application

Creating Users and Associating to a Group


Impersonating a User

Publish the Application

Publishing Applications
Transferring Update Sets

Article Sources and Contributors

Article Sources and Contributors


App Creator Source: http://wiki.servicenow.com/index.php?oldid=232791 Contributors: Cheryl.dolan, Rachel.sienko, Vaughn.romero
Creating a Custom Application Source: http://wiki.servicenow.com/index.php?oldid=235168 Contributors: Cheryl.dolan, Rachel.sienko, Vaughn.romero
Creating a Custom Table Source: http://wiki.servicenow.com/index.php?oldid=232596 Contributors: CapaJC, Cheryl.dolan, Emily.partridge, G.yedwab, Guy.yedwab, Joseph.messerschmidt,
Mark.stanger, Rachel.sienko, Steven.wood, Vaughn.romero, Vhearne
Application Files Source: http://wiki.servicenow.com/index.php?oldid=189643 Contributors: Cheryl.dolan, Rachel.sienko
Fix Scripts Source: http://wiki.servicenow.com/index.php?oldid=189888 Contributors: Rachel.sienko
Publishing Applications Source: http://wiki.servicenow.com/index.php?oldid=231791 Contributors: Rachel.sienko, Vaughn.romero
Conference Room Bookings Source: http://wiki.servicenow.com/index.php?oldid=234943 Contributors: Cheryl.dolan, Joseph.messerschmidt, Rachel.sienko

41

Image Sources, Licenses and Contributors

Image Sources, Licenses and Contributors


Image:Applications.png Source: http://wiki.servicenow.com/index.php?title=File:Applications.png License: unknown Contributors: Rachel.sienko
Image:ApplicationFile.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationFile.png License: unknown Contributors: Rachel.sienko
Image:Warning.gif Source: http://wiki.servicenow.com/index.php?title=File:Warning.gif License: unknown Contributors: CapaJC
Image:SystemApplications.png Source: http://wiki.servicenow.com/index.php?title=File:SystemApplications.png License: unknown Contributors: Rachel.sienko
Image:SystemDefinition.png Source: http://wiki.servicenow.com/index.php?title=File:SystemDefinition.png License: unknown Contributors: Rachel.sienko
Image:ApplicationTables.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationTables.png License: unknown Contributors: Rachel.sienko
Image:ApplicationsPicker.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationsPicker.png License: unknown Contributors: Rachel.sienko
Image:ConflictDialog.png Source: http://wiki.servicenow.com/index.php?title=File:ConflictDialog.png License: unknown Contributors: Rachel.sienko
Image:MoveFile.png Source: http://wiki.servicenow.com/index.php?title=File:MoveFile.png License: unknown Contributors: Rachel.sienko
Image:ContentpageUnload.png Source: http://wiki.servicenow.com/index.php?title=File:ContentpageUnload.png License: unknown Contributors: Rachel.sienko
Image:UpdateSet.png Source: http://wiki.servicenow.com/index.php?title=File:UpdateSet.png License: unknown Contributors: Rachel.sienko
Image:DeleteApplication.png Source: http://wiki.servicenow.com/index.php?title=File:DeleteApplication.png License: unknown Contributors: Rachel.sienko
Image:DeleteApplicationFinished.png Source: http://wiki.servicenow.com/index.php?title=File:DeleteApplicationFinished.png License: unknown Contributors: Rachel.sienko
Image:RestoreApplication.png Source: http://wiki.servicenow.com/index.php?title=File:RestoreApplication.png License: unknown Contributors: Rachel.sienko
Image:RestoreRecords.png Source: http://wiki.servicenow.com/index.php?title=File:RestoreRecords.png License: unknown Contributors: Rachel.sienko
Image:Live_company_feed.png Source: http://wiki.servicenow.com/index.php?title=File:Live_company_feed.png License: unknown Contributors: Rachel.sienko
Image:RequestTable.png Source: http://wiki.servicenow.com/index.php?title=File:RequestTable.png License: unknown Contributors: Rachel.sienko
Image:CreateModule.png Source: http://wiki.servicenow.com/index.php?title=File:CreateModule.png License: unknown Contributors: Rachel.sienko
Image:AutoNumber.png Source: http://wiki.servicenow.com/index.php?title=File:AutoNumber.png License: unknown Contributors: Rachel.sienko
Image:TableSecurity.png Source: http://wiki.servicenow.com/index.php?title=File:TableSecurity.png License: unknown Contributors: Rachel.sienko
Image:ExtendTable.png Source: http://wiki.servicenow.com/index.php?title=File:ExtendTable.png License: unknown Contributors: Rachel.sienko
Image:NewCMDBclass.png Source: http://wiki.servicenow.com/index.php?title=File:NewCMDBclass.png License: unknown Contributors: Rachel.sienko
Image:RecordProducer.png Source: http://wiki.servicenow.com/index.php?title=File:RecordProducer.png License: unknown Contributors: Rachel.sienko
Image:Caution-diamond.png Source: http://wiki.servicenow.com/index.php?title=File:Caution-diamond.png License: unknown Contributors: John.roberts
Image:UIPolicyRelationships.png Source: http://wiki.servicenow.com/index.php?title=File:UIPolicyRelationships.png License: unknown Contributors: Rachel.sienko
Image:ShowParent.png Source: http://wiki.servicenow.com/index.php?title=File:ShowParent.png License: unknown Contributors: Rachel.sienko
Image:DescendantFiles.png Source: http://wiki.servicenow.com/index.php?title=File:DescendantFiles.png License: unknown Contributors: Rachel.sienko
Image:ShowFile.png Source: http://wiki.servicenow.com/index.php?title=File:ShowFile.png License: unknown Contributors: Rachel.sienko
Image:ShowRelatedRecord.png Source: http://wiki.servicenow.com/index.php?title=File:ShowRelatedRecord.png License: unknown Contributors: Rachel.sienko
Image:ApplicationFiles.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationFiles.png License: unknown Contributors: Rachel.sienko
Image:FixScripts.png Source: http://wiki.servicenow.com/index.php?title=File:FixScripts.png License: unknown Contributors: Rachel.sienko
Image:FixScriptTest.png Source: http://wiki.servicenow.com/index.php?title=File:FixScriptTest.png License: unknown Contributors: Rachel.sienko
Image:ProgressWorkers.png Source: http://wiki.servicenow.com/index.php?title=File:ProgressWorkers.png License: unknown Contributors: Rachel.sienko
Image:ApplicationFixScripts.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationFixScripts.png License: unknown Contributors: Rachel.sienko
Image:PublishApplication.png Source: http://wiki.servicenow.com/index.php?title=File:PublishApplication.png License: unknown Contributors: Rachel.sienko
Image:RoomTable.png Source: http://wiki.servicenow.com/index.php?title=File:RoomTable.png License: unknown Contributors: Rachel.sienko
Image:CampusChoices.png Source: http://wiki.servicenow.com/index.php?title=File:CampusChoices.png License: unknown Contributors: Rachel.sienko
Image:ElevatePrivilege.png Source: http://wiki.servicenow.com/index.php?title=File:ElevatePrivilege.png License: unknown Contributors: Rachel.sienko
Image:ReadRole.png Source: http://wiki.servicenow.com/index.php?title=File:ReadRole.png License: unknown Contributors: Rachel.sienko
Image:ShowApplication.png Source: http://wiki.servicenow.com/index.php?title=File:ShowApplication.png License: unknown Contributors: Rachel.sienko
Image:RequestsList.png Source: http://wiki.servicenow.com/index.php?title=File:RequestsList.png License: unknown Contributors: Rachel.sienko
Image:RequestForm.png Source: http://wiki.servicenow.com/index.php?title=File:RequestForm.png License: unknown Contributors: Rachel.sienko
Image:RequestModule.png Source: http://wiki.servicenow.com/index.php?title=File:RequestModule.png License: unknown Contributors: Rachel.sienko
Image:LocationDictionary.png Source: http://wiki.servicenow.com/index.php?title=File:LocationDictionary.png License: unknown Contributors: Rachel.sienko
Image:SearchIcon.png Source: http://wiki.servicenow.com/index.php?title=File:SearchIcon.png License: unknown Contributors: CapaJC, Rachel.sienko
Image:LocationLookup.png Source: http://wiki.servicenow.com/index.php?title=File:LocationLookup.png License: unknown Contributors: Rachel.sienko
Image:EmailNotification.png Source: http://wiki.servicenow.com/index.php?title=File:EmailNotification.png License: unknown Contributors: Rachel.sienko

42