OBLYTECH Logo
OBLYTECH Logo

Mobile Card Builder: Card Templates, Fields and Card Actions

Mobile Card Builder is the visual editor for the cards that ServiceNow mobile apps use to show record information. A card takes its layout from a card template, and the card maps record fields into it. This page covers the two card types, template components, card action buttons, and how a finished template reaches a screen.

Where cards appear in the mobile interface

Cards carry record information into launcher screen record sections, calendar screens, form screens, Genius search results, list screens and map screens. Before you start, confirm which card type you are editing, because the options available to you depend on it.

Choose between a card template and a legacy card

Screens created in the Quebec release and later use cards built on view configurations. These cards can take their layout from a card template. Mobile applets created in Paris and earlier releases use item-view-based legacy cards, which can still be edited in Mobile Card Builder but with limits.

Aspect Card with a template Legacy card
Built on View configuration (Quebec and later) Item view (Paris and earlier)
Card template assignment Supported Not supported
Reset stage option Available Disabled in the menu
Where layout changes are made In the card template Directly in the card

Find your way around the open screen

When Mobile Card Builder opens, a pop-up lists what you can work on. Cards edits an existing card design, and the Application and Applet lists narrow the results to a specific application and applet. Templates builds a card from an existing template, or from a Create blank template button in the upper right corner. Default templates holds the templates ServiceNow created. Custom templates holds templates you created or customized from the defaults, and My templates holds the ones you built. Select a template image and choose Open in the lower right corner.

Create a card template from scratch

Creating a template needs the admin or delegated developer role. Navigate to All, then System Mobile, then Mobile Card Builder, and select Create blank template in the open screen pop-up.

The Template properties window asks for a name and a short description. Use the short description to name the record type the template suits, such as incidents or user records. Save, and the builder opens with an empty card.

You can also start from Mobile App Builder. Select your application scope, open Cards and icons, choose New, select Card template and then Continue. The record asks for a Name, a Description and an Active setting. Active decides whether the template is available for use. Save, select Open in Mobile Card Builder, edit the appearance, save again and close the builder.

Build the layout from components

Six component types make up a card: button, container, icon, image, text and video. Height and width are set in pixels, and a blank width on a button or container fills the available space. Margins on all four sides and a corner radius control spacing and shape.

Containers hold other components, including other containers. You set the direction to Horizontal or Vertical, the alignment to Stretch, Center, Left, Right, Top or Bottom, and the distribution to Equal or Auto.

Text components show a field label, a field value or static text you type. A text component has no background of its own. For a colored background behind text, place the text inside a container and change the container’s background.

Image components take a picture from a mapped field, such as the Avatar field on a user record, or from an attachment. Icon components display an icon chosen from a dropdown on the configuration screen. Video components embed a YouTube or Vimeo video, from a URL or a mapped field, and playback can be Fullscreen or Inline.

Use the builder panels

The top panel shows the card’s height and width in pixels, and it holds Undo, Redo and Save. Ctrl+Z or Cmd+Z undoes a change, and Ctrl+Shift+Z or Cmd+Shift+Z redoes one.

The left panel shows the card name and a component tree. Selecting an item highlights it in the center panel and opens its settings on the right. The center panel is the design canvas: a plus icon adds a component, a trash icon removes one, and Preview shows the card as the app will display it. The right panel holds settings such as size, margins, corner radius and text alignment. The Menu in the top panel offers Open, Edit card properties, Change template and Reset stage.

Map record fields into text elements

Text elements are how a card shows record data. Each one displays either the label of a field or the value of a field. In the example for an incident card, State, Number and Short description display as values, while Opened by and Priority each appear as a label and value pair.

To map a field, select a text element and set Field type to Field value or Field label. Under Mapped field, select the list button, choose the field in the Select a field window, and confirm. For a name and its value side by side, place two text elements next to each other, one set to label and one set to value. Save when you finish.

Add card actions with buttons

Card actions let a user act inside a card, such as accepting or rejecting a suggestion, calling a listed contact or adding an item to a cart. Buttons on the card are easier to find than swipe actions or menu items.

To add one, open a template from the Templates section, or create a blank template. Select the plus icon, choose Button, and set its height, width, border, rounded edges and margins.

Next, choose the format. Label gives a text button, such as OK. Icon gives an icon button, such as a trash icon for delete. The Icon format shows an accessible name field, and that text is read aloud to people using assistive devices.

The action setting controls how many functions the button runs. A single action uses the function menu, where you search for one function. A multi action opens a menu of card actions at the bottom of the screen when tapped. Select Add Menu Item for each action, then Finish after each one. Drag the order icon to change the sequence.

Background, text and border colors can be entered as hexadecimal values or picked from an appearance palette using its Swatches or List tab. Select Save when the button is complete.

Predefined and configured functions

Predefined functions need no extra setup. Continue moves the user forward through a pop-up workflow. Cancel stops that workflow. Log Out signs the user out of the mobile app. Configurable functions come from the Functions table, where each record holds the sys_sg_button definition that the button runs.

Apply the template to a card on a screen

Open Mobile Card Builder from the web interface, using System Mobile and then Mobile Card Builder. In Card builder, choose Menu, then Open. Use the Application and Screen lists to find your screen, and select Open in the lower right corner. Then choose Menu, then Change Template and pick your template.

After the template is applied, assign field values and select Save. You can start the same process from Mobile App Builder. Create a card by selecting New, then Card, then Continue. The Card record asks for a Name, a Description and an Active setting, plus the Data table the card reads from and the Card template it uses. Card fields add table fields that the template does not already include. UI rules define how the interface changes or which fields update when a condition is met. An Advanced scripting of UI rule conditions toggle lets those rules use variables that are not part of the template.

A record with unsaved changes in Mobile App Builder cannot be opened in Mobile Card Builder, so save it first.

Make icon buttons readable with voiceover text

A button defined as an icon type may need alternative text so a screen reader can announce it. Open the card template from the sys_sg_view_template list and select the button element. In the Card template element attributes area, select New, enter AlternateTextValue as the Type, and put the words to be read aloud in the Translatable value field. Select Submit, then Update on the element page.

Work with legacy cards

Legacy cards can be edited with many of the same tools, with a few exceptions. They cannot be assigned a card template, and the Templates option and Reset stage option both appear disabled in their menu. Because a legacy card has no separate template record, you change its containers, fields and appearance directly on the card. For the common mobile experience mistakes to avoid, see common ServiceNow mobile experience mistakes and how to avoid them.

Use color variables so cards follow your theme

Card view templates read their appearance from the Template JSON field. Rather than hard-coding colors, point each property at a color variable from the UX Theme Properties table. Text, HTML text and standalone icons use TextColorVariable. Background uses ColorVariable, and the view group uses BackgroundColorVariable. The onselect state, defined in the root view attribute JSON, takes both a text color variable and a background color variable. For the wider picture of mobile experience design, see mobile experience best practices.

Frequently asked questions

Can I change the look of a legacy card by editing a template?

No. A legacy card has no separate template record, so change its containers, fields and appearance directly on the card.

Why will Open in Mobile Card Builder not open my record?

The record probably has unsaved changes in Mobile App Builder. Save them first, then open the builder again.

What does a multi action button do when a user taps it?

It opens a menu at the bottom of the screen listing the card actions you added. Drag the order icon in the builder to change their sequence.

Why does an icon button need voiceover text?

A screen reader announces it. Add an AlternateTextValue attribute to the button, with the spoken words in the Translatable value field.