Free cookie consent management tool by TermsFeed Database-Backed Record Type Tutorial [Appian Records]
Database-Backed Record Type Tutorial

If you are new to Appian and unfamiliar with Appian design objects and concepts, check out Appian Academy Online.

Introduction

Appian Records enable you to do more with your data. Regardless of where your data lives, Appian allows you to organize your data into actionable records that allow users to access and update the information that they need.

For example, think about an employee record. What information about the employee would you want to see? You'd probably want to have the employee's name, title, department, and start date readily available. What might you want to do? At some point you would likely have to update the employee's information. You might also need to add a new employee. These common actions can be directly added to your record type and can be referenced in other interfaces and processes.

This tutorial should take less than an hour to complete and will walk you through the steps to create an Employee record type with data sync enabled. This tutorial contains four parts: (1) setup and creating your record type, (2) configuring your record list, (3) generating your record views, and (4) generating your record actions.

Objectives

  1. In the first part, we will set up our application and supporting objects, as well as bring together our data and record type to begin connecting our users with the data. To do this, we will:

    • Create the Appian Tutorial application.
    • Add a managers group.
    • Create our record type and data source.
    • Add data to our record type.
  2. In the second part, we will structure the way that our users will initially interact with the set of records through the record list. To do this, we will:
    • Configure the record list by selecting which columns we want to see in the list.
    • Create a user filter for users to filter the records in the list.
  3. In the third part, we will create a way for users to drill into each record. To do this, we will:
    • Generate and configure record views so that users can see specific record data through different perspectives.
    • Configure the record title and header to fit our needs.
  4. In the last part, we will allow users to take action on our data from the context of the record list and the records themselves. To do this, we will:
    • Generate a create, update, and delete record action
    • Display record actions so they appear in the proper locations.
    • Secure our actions so only managers can update an employee's information or delete it.

After successfully completing this tutorial, you will be ready to create your own record types.

Requirements

  • This tutorial takes advantage of codeless data modeling, which requires an environment connected to a MariaDB database. For example, an Appian Cloud or an Appian Community Edition environment.

  • Ensure you are familiar with the different design objects that will be referenced throughout this tutorial:

Part 1: Setup

Before we can create our record type, we need to create an application. We'll take advantage of Appian's automatic group and folder generation during application creation, so we'll automatically have our initial application infrastructure. We'll also add a group specific to this tutorial, then add the data for our record type.

Create the Appian Tutorial application

Tip:  The Appian Tutorial application is used throughout Appian tutorials. Skip the steps in this section if you've already created this application in another tutorial.

To begin with, we need to create an application to contain our design objects.

We will be creating the Appian Tutorial application for this tutorial. All of Appian's tutorials use the Appian Tutorial application as the reference application. After completing this tutorial, you can reuse this application as you work through other Appian tutorials.

To create the Appian Tutorial application:

  1. Log in to Appian Designer (for example, myappiansite.com/suite/design).
  2. In the Applications view, click +New Application.
  3. In the Create New Application dialog, configure the following properties:

    Property Description
    Name Enter Appian Tutorial.
    Prefix Keep the default prefix, AT, which Appian constructs using the initial characters of each word you entered in the Name parameter. We'll be following the recommended naming standard, and using this short, unique prefix whenever we name an object in this application.
    Description Leave blank. It's normally a best practice to add descriptions to all design objects. However, to save a little time during this tutorial, we'll skip adding descriptions unless the description displays to the end user.
    Generate groups and folders to secure and organize objects Keep this checkbox selected, so that Appian will automatically generate standard groups and folders and assign default security groups for this application.
  4. Click CREATE.
  5. In the Review Application Security dialog, keep the default security settings. Because we selected the Generate groups and folders option in the previous step, Appian automatically uses the AT Users and AT Administrator groups it generated to set our application security appropriately.

    Tip:  The security of the application object is unrelated to the security of each of the objects contained within the application. This means that you will need to set security permissions for every object in an application in addition to the application object itself. For more information about security permissions for the application object, see Application Security.

  6. Click SAVE.

    screenshot of the Explore view

Right now, the application contains the folders and groups Appian generated automatically. To see these, click Build in the navigation pane. Each design object that you create during the course of this tutorial will appear in this list in the Build view and be associated with the tutorial application.

screenshot of the build view

Because we selected the Generate groups and folders to secure and organize objects option while creating the object, Appian generates standard groups and folders for the application, as well as assigns the generated groups as the default security groups for the application.

In this tutorial, we'll be using the following generated groups and folders:

  • AT Administrators group to contain all administrators of the Appian Tutorial application.
  • AT Users group to contain all users of the Appian Tutorial application.
  • AT Rules & Constants folder to contain all our expression rules, constants, and interfaces in this folder throughout the tutorial.
  • AT Models folder to contain all our process models throughout the tutorial.

For each object we now create in this tutorial, Appian will pre-populate the AT Administrators and AT Users groups in the object role maps. Most of the time, we'll be able to keep those pre-populated values. The rest of the time, we'll be assigning permissions to an application-specific managers group, which we'll create now.

Add a managers group

Managers will have a specific part to play in our new application, so let's add a new group for AT Managers.

To add a managers group:

  1. In the application, go to the Build view.
  2. Click NEW > Group.
  3. Configure the following properties:

    Property Description
    Name Enter: AT Managers
    Parent Group Enter AT Users, so that users in this group inherit Viewer permissions for the application.
    Group Members Enter your user name.
  4. Click CREATE.
  5. In the Review Group Security dialog, keep the default settings. AT Administrators group should be assigned Administrator permissions for the group.
  6. Click SAVE.

Create the employee record type and add data

In the last part of the setup, you'll need to create the employee record type and add the data that we'll use throughout this tutorial.

The Use the Write Records Smart Service Function on an Interface recipe will walk you through how to create the Employee record type, set up your data model, and add your employee data.

Part 2: Configure the record list

Now that we have our record type and data, let's configure the record list so users can find the records they need. Once we've configured the record list, we're going to add a user filter so users can filter the list by department.

Configure record list columns

We'll start by configuring the fields displayed in the record list. We only want to display select fields since this data is meant to be viewed at a glance before users drill into each record.

When looking at a list of employees, we really only want to see their name, title, and department. To configure the record list to show only these columns, we are going to remove the ID, phone number, and start date columns, and combine the first and last name columns into one.

To remove unnecessary fields:

  1. In the record type, go to List.
  2. Click EDIT LIST.
  3. In the Columns section of the Grid configuration, delete the Id column by hovering over and clicking .

    Note:  We don't need to show the Id column in the record list, because the record field is primarily used by the database to identify records and not used by users.

  4. Delete the Phonenumber and Startdate columns in the same way.

Next, we will combine the first and last name columns into one Name column. We will also add sorting to allow users to easily sort data in a column, and set the display value to let the column know which record field to show.

To create the Name column:

  1. In the Columns section, delete the Lastname column by hovering over and clicking .
  2. In the Columns section, click Firstname.
  3. In the Label field, change firstname to Name.
  4. In the Sort Field field, remove firstname and select lastname.
  5. Under Display Value, click Link.
  6. Under Links, click List of Links.
  7. Under Links, click Record Link.
  8. Hover over Label, then click Edit as Expression .
  9. To concatenate the first and last names to show both values in the same field, copy and paste the following expression:

    fv!row[recordType!ATEmployee.fields.firstname] & " " & fv!row[recordType!ATEmployee.fields.lastname]

  10. In the expression, change the record type references to use the record type reference in your environment:
    • Remove the existing record field reference.
    • Enter recordType!, then select your AT Employee record type from the context menu.
    • Enter . after recordType!AT Employee, and select fields from the first context menu and lastname from the second context menu.

    Note:  Record type field references are specific to each record type and environment. This means that you need to reference the record type fields from your own environment whenever you copy and paste a record type reference from outside the application.

  11. Click OK to close the expression editor.
  12. Click OK to close the list editor.

  13. Click SAVE CHANGES.
  14. To test the record list, open the link under URL. The record list will open in Tempo.

Add a user filter

Now that we've configured the record list columns, we can add a user filter. Let's enable users to easily filter the record list by department. We'll use a department constant along with the a!forEach() function to make creating and maintaining our user filter easier.

To add a new user filter:

  1. Return to the AT Employee record type.
  2. In the record type, go to Search and User Filters.
  3. Under User Filters, click New User Filter.
  4. Select Expression.
  5. For Name, enter Department.
  6. Under Filter Expression, click Create Constant Create constant icon.
  7. In the Create Constant dialog, for Name, enter: AT_DEPARTMENT_LIST.
  8. For Type, select Text.
  9. Select the Array checkbox.
  10. For Value, enter the department options. Separate each department by a line break, but do not include spaces, commas, or quotations:

    1
    2
    3
    4
    5
    
    Engineering
    Finance
    Sales
    Human Resources
    Professional Services
    
  11. In the Application field, enter Appian Tutorial.
  12. In the Save In field, enter AT Rules & Constants.
  13. Click CREATE. The constant is created in your application and appears in the Filter Expression field of the Create New User Filter dialog.
  14. In the Filter Expression field, replace the new constant reference with the following expression:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    
    a!recordFilterList(
        name: "Department",
        options: a!forEach(
        items: cons!AT_DEPARTMENT_LIST,
        expression: a!recordFilterListOption(
            id: fv!index,
            name: fv!item,
            filter: a!queryFilter(
            field: recordType!AT Employee.fields.department,
            operator: "=",
            value: fv!item
            )
        )
        )
    )
    
  15. In the expression, change the record type reference recordType!AT Employee.fields.department to use the record type reference in your environment.

    Note:  Record type field references are specific to each record type and environment. This means that you need to reference the record type fields from your own environment whenever you copy and paste a record type reference from outside the application.

  16. Click OK.
  17. Click SAVE CHANGES.
  18. To test the user filter, go to List in the record type and open the link under URL. The record list will open in Tempo and automatically display the new user filter.

Part 3: Define your record views

Next, we will configure the records in the record type by generating a Summary view. The Summary view displays information for a single record.

By generating this view, Appian will create the interface and configure the view for us. Then, we will configure the record header background color and the record title with the employee's name.

Generate an employee summary interface

Because the Employee record type has data sync enabled, you can quickly generate the Summary view interface, as follows:

  1. Return to the AT Employee record type.
  2. In the record type, go to Views and Header.
  3. Click GENERATE RECORD VIEW.

    /record view empty state

  4. For Data Included in Your Record View, leave the default selection of the Employee record type. This will display all fields from the Employee record type in your record view.
  5. Click NEXT.
  6. For Record View Name and Application, leave the default configurations:

    Property Value
    View Name Summary
    Application Appian Tutorial
  7. Click NEXT.
  8. Review the objects that Appian will use for your new record view:

    Note:  If an existing Rules and Constants folder is being used, Groups will be hidden since they have already been configured for the folder.

  9. Click GENERATE VIEW. Appian generates the new interface.
  10. Click CLOSE. Your new Summary view displays in the Record Views table.

    Since we generated the Summary view, Appian automatically added the interface as the Summary view for the record type. All we need to do now is save it.

  11. Click SAVE CHANGES.

Configure the record header background

Now that our Summary view is configured, let's configure a record header background. The record header background contains the title, breadcrumbs, and related actions on every record view of your record.

You can opt for no background or you can set an image or color. We are going to configure a light blue background:

  1. In the Header section, for Record Header Background, select COLOR.
  2. For Color, keep the default Static Color.
  3. In the hex code text editor, enter #F3F9FF to select a light blue color.

Notice in the Preview that the header now displays with a light blue background.

Configure the record title

Now, we'll configure the record title so that it will show the employee's first and last name. We are adding the employee's name as a record title so that a user landing on this page will understand what they are looking at without having to navigate to the record list.

Since our record type has data sync enabled, Appian automatically configures the record title to use the first Text field after the primary key field in the record type. In this tutorial, that field is the employee's first name. We want the title to be the employee's first and last name, so we'll configure an expression that concatenates the firstName and lastName record fields.

  1. In the Header section, select Expression.
  2. In the expression editor, copy and paste the following expression:

    1
    
     rv!record[recordType!AT Employee.fields.firstName] & " " & rv!record[recordType!AT Employee.fields.lastName]
    
  3. In the expression, change the record type references to use the record type reference in your environment.

    Note:  Record type field references are specific to each record type and environment. This means that you need to reference the record type fields from your own environment whenever you copy and paste a record type reference from outside the application.

  4. Click SAVE CHANGES.
  5. To preview the Summary view, go to List in the record type and open the link under URL.
  6. From the record list, select an employee to view their Summary view. Notice that the employee's full name appears in the record title.

Part 4: Generate record actions

In this last part of the tutorial, we'll generate some common record actions.

Since the Employee record type has data sync enabled, you can generate actions to create, update, and delete records. Since we only want managers to have the ability to update and delete employee information, we'll also add security on those related actions.

Generate create, update, and delete actions

We need to create three record actions: Create Employee, Update Employee, and Delete Employee. Luckily, we can generate all of our record actions at once.

To generate the create, update, and delete employee actions:

  1. Return to the AT Employee record type.
  2. In the record type, go to Record Actions.
  3. Click GENERATE RECORD ACTIONS.
  4. Keep the default so all actions are selected.

  5. Click GENERATE.

Appian generates the actions, creating and configuring the record actions and the objects supporting those actions in your application.

Now that Appian has done all of the heavy lifting to create our record actions, let's add the Update Employee and Delete Employee actions to the Summary view.

Right now, these related actions will only appear on the Related Actions view on each record, but we'll add a related action shortcuts so managers can more quickly update or delete employee information while viewing the summary.

To add the related actions to the Summary view:

  1. In the record type, go to Views and Header.
  2. Click next to Summary.
  3. In the Edit View dialog, under Related Action Shortcuts, select the checkboxes for Update Employee and Delete Employee.
  4. Click OK.
  5. Click SAVE CHANGES.

Since we don't want everyone to be able to update or delete an employee's information, we are going to make sure that only those in the manager group are able to view and use these related actions.

To set security on the related action:

  1. In the record type, go to Views and Actions Security.
  2. Go to the Actions tab.
  3. Click next to the Update Employee action.
  4. In the Edit Update Employee Security dialog, click Create Constant Create constant icon.
  5. In the Create Constant dialog, for Name, enter: AT_MANAGERS_GROUP.
  6. For Type, select Group.
  7. For Value, enter AT Managers.
  8. In the Application field, enter Appian Tutorial.
  9. In the Save In field, enter AT Rules & Constants.
  10. Click CREATE. The constant is created in your application and appears in the Edit Update Employee Security dialog.
  11. In the expression box, replace the new constant reference with the following expression:

    a!isUserMemberOfGroup(loggedInUser(), cons!AT_MANAGERS_GROUP)

    The a!isUserMemberOfGroup function checks that a user (in this case, the logged-in user) is a member of the mangers group. If they are, the related action will be visible.

  12. Click OK.
  13. Click next to the Delete Employee action.
  14. In the Edit Delete Employee Security dialog, enter the following expression:

    a!isUserMemberOfGroup(loggedInUser(), cons!AT_MANAGERS_GROUP)

  15. Click OK.
  16. Click SAVE CHANGES.

Test record actions

In this last step, we'll test out our record actions.

To test the record list action:

  1. In the record type, go to List.
  2. Open the link under URL.
  3. On the record list, click + NEW EMPLOYEE.
  4. Enter some information in the form.
  5. Click CREATE. The new employee should appear in the record list.

To test the related action:

  1. From the record list, select an employee to view their Summary view.
  2. Click UPDATE EMPLOYEE.

  3. Update some information in the Update Employee form.
  4. Click SAVE. The Summary view should update to reflect your changes.
  5. Click DELETE EMPLOYEE.
  6. In the Delete Employee dialog, click DELETE.

Congratulations!

You did it! You made it through all of the parts and steps to successfully create a fully functioning record type with a Summary view, record actions, and a user filter. You are now ready to create record types that enable your own unique business data to do more all on your own!

Database-Backed Record Type Tutorial

FEEDBACK