You are on page 1of 8

Appian Step-by-Step #3

Exercise to Accompany
Expressions: Transform Your Data

The Appian Step-by-Step series consists of 10 exercises that accompany


the courses in the Appian Developer learning path. Exercises build upon
each other. Complete exercises in order and keep the app and all
objects until you are done with the project.

1 Manage Users and Groups

2 Manage Data Easily with Custom Data Types

3 Expressions: Transform Your Data

4 Interfaces 101: Build Forms and Other Interfaces

5 Process Modeling: Automate Your Business Processes

6 Query Data from RDBMS

7 Design Appian Records

8 Reports: Build Basic Charts and Grids

9 Sites: Create a Custom and Focused User Experience

10 Interfaces 102: Build Interfaces Using an Expression

© Appian Corporation, 2020


Introduction 2
How to Complete the Exercises in this Guide? 2
What Will I Build? 2
How Can I Get a Practice Environment? 2
Use Initials in a Shared Environment 2
Save Often 2
Additional Resources 3

1 - Create Rules and Constants 4


Create an Array of Text Values Constant 4
Create a Constant Pointing to the Data Store Entity 5
Create an Expression to Calculate Next Maintenance 5

Notice of Rights

This document was created by Appian Corporation, 7950 Jones Branch Dr, Tysons, Virginia 22102.
Copyright 2021 by Appian Corporation. All rights reserved. Information in this document is subject to
change. No part of this document may be reproduced or transmitted in any form by any means,
without prior written permission of Appian Corporation. For more information on obtaining
permission for reprints or excerpts, contact Appian Training at academyonline@appian.com.

Appian 21.3 Appian Step-By-Step


© Appian Corporation, 2021 Page 1
How to Complete the Exercises in this Guide
This guide offers a series of exercises that will teach you how to build a functional Appian
application, step-by-step. Please use this guide to support your learning throughout the
Appian Developer online curriculum.

To understand specific Appian concepts and features, we recommend that you first view our
online courses (access our curriculum at academy.appian.com), and then complete the
associated exercises before moving to the next course in the path.

What Will I Build?


You will build the Vehicle Fleet Management (VFM) application that will automate the process
of registering a new vehicle in the fleet. This app will be designed for two personas: Registrars
and Supervisors. Registrars will use the VFM application for entering the new vehicle
information into an online form, which will be then sent to Supervisors for approval. After
approval, the new vehicle will be written to the database. After you build all key design
objects, you will assemble them into a user-friendly Site that Registrars and Supervisors will
use for adding and approving vehicles and for accessing all fleet-related reports.

How Can I Practice?


Sign up for Appian Community Edition here:
https://community.appian.com/p/my-learning-journey/. This free, unlimited-time Appian
instance comes with the pre-built VFM application that you can use to reference while building
your own version.

If you already have access to a practice environment, you will need a user account with either
System Administrator access, or an account for a Basic User who is a member of the
Designers and Process Model Creator groups. Request access from your site’s System
Administrator.

Use Initials in a Shared Environment


If you work in a shared environment, prefix all application objects with your initials to avoid
naming conflicts. For example, if your initials are JJ, name your group JJ VFM All Users.

Save Often
Appian does not automatically save updates, so save your objects frequently.

Appian 21.3 Appian Step-By-Step


© Appian Corporation, 2021 Page 2
Additional Resources

Appian provides a plethora of training resources for novice Appian developers. The following
resources are particularly popular with our learners:

Academy Online - Appian’s online courses provide useful survey courses, step-by-step
tutorials, and some additional practice exercises. Explore these resources at your own pace.
Survey courses will help you with developing a better grasp of the range of topics you need to
learn about. Video and print tutorials will help you with getting the hands-on experience with
Appian.
Appian Documentation - Appian’s product documentation will provide you with the overview of
key Appian features, newest release information, additional tutorials, and helpful patterns and
recipes to implement in your app.
Community Discussions for New Users - Join our community of experts to ask questions and
find answers from past discussions.

Appian 21.3 Appian Step-By-Step


© Appian Corporation, 2021 Page 3
1 - Create Rules and Constants

In this chapter, we will create several Rule Objects that we need for our application. Specifically,
we will create three different Constants and three Expression Rules.

Create an Array of Text Values Constant


First, we will create a constant that will hold an array of text values for the user to select from.
This constant will hold the categories of vehicles for our app. To create this constant, follow the
steps below:

1. From within the VFM Constants folder, click New, and select Constant from the
dropdown menu.

2. Type VFM_VEHICLE_CATEGORIES for the Name, and add a description: “Holds an


array of vehicle categories.”

3. In the Type field, select Text, and check the Array box.

4. In the Value field, type the following values on separate lines: Small, Economy, Large,
Luxury.

Appian 21.3 Appian Step-By-Step


© Appian Corporation, 2021 Page 4
5. Select the VFM Constants folder under Save In. Your dialog box will look as follows:

6. Click Create.

Create a Constant Pointing to the Data Store Entity


Now we will create a constant that will point to the vehicle Data Store Entity. These types of
constants are used when we need to identify the source of data (for example, for an expression
rule or a query). Follow the steps below to create this constant:

1. From within the VFM app, click New, and select Constant from the dropdown menu.

2. Type VFM_VEHICLE_DSE_POINTER for the Name, and add a description: “Points to


the Vehicle Data Store Entity.”

3. In the Type field, select Data Store Entity, and then select VFM Data Store in the Data
Store field and vehicle in the Entity field.

Appian 21.3 Appian Step-By-Step


© Appian Corporation, 2021 Page 5
4. Select the VFM Constants folder in Save In, and click Create. Your dialog box
will look as follows:

Create an Expression to Calculate Next Maintenance

In this section, we will create an expression that will help us to calculate the next maintenance
date based on the vehicle category and last maintenance date. For luxury vehicles, the next
maintenance date should be 3 months from the date of its last maintenance, for all other
vehicles - 6 months. Follow the steps below to create this Expression Rule:

1. From within the VFM app, click New and select Expression Rule from the dropdown
menu.

2. In the Name field, type VFM_CalculateNextServiceDate, and add a description: “Given


the category of vehicle and last updated date, return the date of next maintenance.”
Select VFM Expressions in the Save In field. Click Create.

3. In the Rules Inputs pane, click the plus sign to add two rule inputs:

● vehicleType (Text)
● dateUpdated (Date)

Appian 21.3 Appian Step-By-Step


© Appian Corporation, 2021 Page 6
4. Enter the following expression into the Expression Editor:
if(
ri!vehicleType = cons!VFM_VEHICLE_CATEGORIES[4],
edate(ri!dateUpdated,3),
edate(ri!dateUpdated,6)
)
This expression checks whether the vehicle belongs to the Luxury category first, and
then calculates the date of the next maintenance accordingly: by adding 3 or 6 months to
the last maintenance date. This is done with the help of the edate() function that allows
to calculate future dates by adding months to the given date.

5. Click Save Changes. Test this expression by typing Luxury for the vehicleType,
entering any dateUpdated. Then type Economy to see the date of the next
maintenance.

Before you go …

Congratulations! You have completed your third Appian Step-by-Step exercise. Keep
in mind that you will need the objects created so far for your next set of exercises.

Up Next

4 Interfaces 101: Build Forms and Other Interfaces

Appian 21.3 Appian Step-By-Step


© Appian Corporation, 2021 Page 7

You might also like