Records Tutorial

This page provides step-by-step guidance on creating a record type object to display employee information.

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 will take about an hour and will walk you through the steps to create an Employee record type with data sync enabled. This tutorial contains three parts: (1) creating the record type, (2) configuring your record list, and (3) creating your record views and actions.

Objectives

  1. In the first part, we will bring together our data and record type to begin connecting our users with the data. To do this, we will:

    • Create our record type.
    • Configure the data source.
  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 and act upon each record. To do this, we will:
    • Configure the record views so that users can see specific record data through different perspectives.
    • Configure related actions to allow users to update the record that they are viewing.

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

gif demonstrating the completed employee record list, record view, and related action

Requirements

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

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

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. 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.

    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. The application view appears.

    screenshot of the application view

Right now, the application contains the folders and groups Appian generated automatically. Each design object that you create during the course of this tutorial will appear in this list and be associated with the tutorial application.

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 view, click NEW > Group.
  2. 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.
  3. Click CREATE.
  4. In the Review Group Security dialog, keep the default settings. AT Administrators group should be assigned Administrator permissions for the group.
  5. Click SAVE.

Create the employee data

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

To create this data, you must complete the Use the Write to Data Store Entity Smart Service Function with an Interface pattern.

This pattern will create the custom data type (CDT), data store, and data store entity (DSE) we'll use for the record type. As you walk through this pattern, it's recommended to use the application prefix when naming your objects. For example, when creating the employee custom data type, name it AT_Employee since it's in the Appian Tutorial application.

Part 1: Create the Employee record type

Now that we have a data source for the application, we want to connect that data to a record type. We'll create the Employee record type and enable data sync so that Appian can more quickly query the source data, and so you can use sync-enabled features.

Create a record type

To leverage Appian Records functionality, it all starts with a record type object.

We'll use the record type to configure how the data is displayed in the record list, how users interact with the data through record views, and make the data actionable for users through record actions.

To create a record type:

  1. In the application view, click NEW > Record Type.
  2. For Name, enter AT Employee.

    Notice that when you click away from the Name field, the Plural Name field is automatically filled with Employees. This is the name that your users will see when they view the record type from Tempo.

  3. For Description, enter Employees for the Appian Tutorial application. This description displays on the record type list in Tempo.
  4. Click CREATE.
  5. In the Review Record Type Security dialog, keep the default security groups:
    • Permissions for Default (All Other Users) should be set to No Access.
    • Permissions for AT Users should be set to Viewer.
    • Permissions for AT Administrators should be set to Administrator.
  6. Click SAVE. The new record type opens in a new tab.

Configure the data source

Now, we need to tell the record type where the data lives and how we want to access the data.

We're going to use a database table as the source of the record type, and we'll sync the data in Appian for faster queries and sync-enabled features that can help speed up development.

To configure the data source for your record type:

  1. Click TELL US ABOUT YOUR DATA.
  2. For Choose Source Type, keep the default source type Database.

    create a record data source module

  3. Click NEXT.
  4. For Data Sync, keep the default option Build Apps Faster with Sync.

    sync-dialog

  5. Click NEXT.
  6. For Choose Database Table, select atemployee, the data entity that you created during set up.

    choose db table

  7. Click NEXT.
  8. For Configure Source Filters, keep the default settings. We won't add source filters in this tutorial since we want to sync all rows of data in Appian.

    empty-source-filter-tutorial

  9. Click NEXT.
  10. Under Select and Configure Fields to Include, ensure all checkboxes are selected. This will create a set of record fields from the selected source fields.

    select-fields-tutorial

  11. Click FINISH.
  12. Click SAVE CHANGES. This triggers a manual sync to sync your data in Appian.

screenshot of the Source and Default Filters page of the record type

For the purposes of this tutorial, we will leverage immediate syncs and manual syncs. This means that anytime Appian writes to the database table using a smart service in a process model, or whenever we save the record type, a sync will occur with our source data. Learn more about refreshing your synced data.

Part 2: Configure the record list

Now that we have our record 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. On the left navigation menu, click List.
  2. Click EDIT LIST.
  3. In the Columns section of the Grid configuration, delete the Id column by hovering over and clicking .

    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.

    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.

    screenshot of record list columns

  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.

/record-list-tutorial

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. On the left navigation menu, click 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!ATEmployee.fields.department,
           operator: "=",
           value: fv!item
         )
       )
     )
   )
  1. In the expression, change the record type reference recordType!AT Employee.fields.department to use the record type reference in your environment.

    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.

  2. Click OK.
  3. Click SAVE CHANGES.
  4. To test the user filter, click List on the left navigation menu and open the link under URL. The record list will open in Tempo and automatically display the new user filter.

    gif of employee record list and user filter

Part 3: Define your record views and actions

In the final part of this tutorial, we will configure the records in the record type by creating a Summary view and a related action. The Summary view displays information for a single record, and the related action will allow users to update the information about an employee directly from the record.

Create a Summary view interface

In this step, we will generate a Summary view. 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

To generate a Summary view interface:

  1. Return to the AT Employee record type.
  2. On the left navigation menu, click Views and Header.
  3. Click GENERATE INTERFACE on the blue banner at the top of the page. The Create Interface dialog appears.

    When your record type has data sync enabled, this option will appear the first time you configure the Summary view, and whenever the view is empty or null.

    /generate-interface-tutorial

  4. In the Create Interface dialog, keep the default values.

    /create-interface-tutorial-generated

  5. Click CREATE. The interface opens in a new tab and displays your formatted record data.

    generated-summary-view-tutorial

Update the generated employee summary interface

The generated Summary view will display each record field in a read-only Text component. Since this interface is only meant to be viewed and not edited, it follows the related design best practices, such as using adjacent field labels and using a record data type as the rule input.

The generated interface is fully configured, so all we need to do is make some small formatting adjustments.

To update the generated interface:

  1. Click and drag the Text components to reorganize them:
    • Move the Text components Firstname, Phonenumber, and Title to the left column.
    • Move the Text components Lastname, Department, and Startdate to the right column.
  2. Select the Firstname Text component.
  3. In the component's configuration, change the Label property to a more readable value, First Name.
  4. Follow these same steps for the Lastname, Phonenumber, and Startdate components.
  5. Click SAVE CHANGES. Your interface should look like this:

    screenshot of employee summary view interface

  6. Close the interface.

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.

To save this configuration:

  1. Return to the Views and Header page in the AT Employee record type.

    Notice that the Interface expression is populated with the new interface rule and uses the rv!record variable to call in the data for each record and display that data in the record's Summary view.

    preconfigured-view

  2. Click SAVE CHANGES.

Configure the record header background

While we are on the Views and Header page, let's go ahead and 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 gray 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 #666666 to select a dark gray color.

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.

    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, click List on the left navigation menu 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.

    /summary-view-tutorial

With our Summary view set up to view employee information, the last thing we'll do is add a related action so users can update a record.

We will create a related action for managers to update employee information from the Summary view. We will create the related action in two steps. In the first, we will create an expression rule and a reusable interface. In the second, we'll create a process model.

In your own application, you can skip creating these objects when you generate a record action. If you use a database table with data sync enabled as the source of your record type, Appian can generate common record actions for that record type using basic information you provide. To use this feature, your underlying data source must include the proper JPA annotations.

Make rule!AT_getEmployeeById

First, we will create an expression rule that queries the DSE to get employee information by the record ID.

In the next few steps, we will use this expression rule to help us test our reusable interface, pull in employee data to work with the logical expressions in that interface, and pass in the correct employee data to the process models that we'll be creating.

To create our expression rule:

  1. In the application view, click NEW > Expression Rule.
  2. Keep the default setting, Create from scratch.
  3. For Name, enter: AT_getEmployeeById
  4. In the Save In field, keep the default AT Rules & Constants.
  5. Click CREATE. The expression rule opens in new window or tab.
  6. Click RULE INPUTS in the top right corner to add a rule input.
  7. In the Name field, enter id.
  8. In the Type field, select Number (Integer).
  9. In the expression editor panel, copy and paste the following expression:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    
    a!queryEntity(
      entity: cons!AT_EMPLOYEE_ENTITY,
      query: a!query(
        logicalExpression: a!queryLogicalExpression(
          operator: "AND",
          filters: {
            a!queryFilter(
              field: "id",
              operator: "=",
              value: ri!id
            )
          },
          ignoreFiltersWithEmptyValues: true
         ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 1
        )
      ),
      fetchTotalCount: false
     ).data
    
  10. In the Test Inputs section of the Ad Hoc Test panel, enter a valid record ID in Value. We will use the record ID 1 throughout the tutorial.
  11. Click TEST RULE. You will see the employee information displayed in the Test Output section.

    /expression-rule-tutorial

  12. Click SAVE CHANGES.
  13. Close the expression rule.

Create an update employee interface

With our expression rule created, now let's make a reusable interface. Reusable interfaces allow us to use the same interface multiple times instead of having to create multiple similar interfaces.

We'll use this interface for our related action and, later on, in our record list action. The reusable interface will show the same employee information as the Summary view, but the fields will be editable. To make this interface functional for both the related and list actions, we will write two conditional expressions: one will show the different form labels, and the other will make components editable depending on the action.

To make a reusable employee interface:

  1. In the application view, click NEW > Interface.
  2. For Name, enter: AT_createEditEmployee
  3. For Save In, keep the default AT Rules & Constants.
  4. Click CREATE. The interface opens in a new window or tab.
  5. In the BUILDERS section of the templates pane, click CREATE FROM DATA TYPE.
  6. For Data Type, select the AT_Employee custom data type created during setup.

    We're using the employee CDT here, instead of the Employee record type, because we want to pass data from this interface into a process model. You should only use record data types as rule inputs if the interface is read-only.

  7. For Generate an Interface for, select Editing Data.
  8. Click GENERATE.

Now that our editable interface is created, let's replace the Department text field with a dropdown component. This will allow users to select from a pre-defined list of departments when updating the employee information, instead of entering a department in a field every time or entering a department name incorrectly.

To replace the Department text field with a dropdown component:

  1. Select the Department Text field, then from the context menu, choose Delete.
  2. From the PALETTE panel, drag a DROPDOWN component onto the interface where the old Department Text field was.
  3. In the COMPONENT CONFIGURATION panel for the new dropdown component, configure the following properties:
    • For Label, enter Department.
    • For Placeholder Label, enter ---Select a Department---.
    • For both Choice Labels and Choice Values, click Edit as Expression , replace the existing expression with cons!AT_DEPARTMENT_LIST, then click OK.

    After you change the Choice Label to use the constant, an error will appear. This is expected since the Choice Label and Choice Values fields currently have different values. The error will resolve itself when you change the Choice Values field to use the same constant.

  4. For both Selected Value and Save Selection To, select ri!AT_Employee.department from the dropdown list.
  5. Click SAVE CHANGES.

Add an expression rule as the test value

Next, we're going to add our expression rule to the interface as a test value. We'll use the record ID 1 to pass the record data into the interface so that we can see the fields populated with employee data. This will allow us to verify our conditional logic in the next few steps.

To add a test value:

  1. In the header bar, click TEST.
  2. For the AT_Employee rule input, replace the current expression with rule!AT_getEmployeeById(1).
  3. Click Set as default test values.
  4. Click TEST INTERFACE. You will now see the employee's information in the fields.

    /test-interface-record-action

  5. Click SAVE CHANGES.

Add conditional logic to make the form reusable

Now we are going to configure two expressions for our form label and the start date field so that this form will work with our related action and record list action.

First, we will add an expression in our form label so that it will show "Update Employee" when managers are using the related action, or "Add New Employee" when managers are adding an employee record.

In configure the form label:

  1. Click the Form Layout component to select it.
  2. In the COMPONENT CONFIGURATION panel, hover over Label, then click Edit as Expression .
  3. Replace the current value with the following expression:

    1
    
    if(ri!AT_Employee.id, "Update Employee", "Add New Employee")
    

    This expression says that if the Id rule input field is null, the label will read "Add New Employee". If the Id rule input field is not null, then the label will read "Update Employee".

  4. Click OK.

    /update-employee-interface

Now, we'll do something similar for the Start Date field.

When managers are updating the employee information, they won't need to change the start date of the employee since that is a static value. So we'll add an expression using not() and isnull() to make the Start Date field appear as read-only when managers are using the related action, and editable when they are adding a new employee record.

To configure the Start Date field:

  1. Click the Start Date component to select it.
  2. In the COMPONENT CONFIGURATION pane, hover over Disabled, then click Edit as Expression .
  3. Enter the following expression:

    1
    
    not(isnull(ri!AT_Employee.id))
    

    The not() function returns either true or false. This means that if the id rule input field is not null, the field is disabled. If the rule input Id field is null, the field is not disabled and you can edit it.

  4. Click OK.
  5. Click SAVE CHANGES.

    screenshot of the update employee interface

  6. Close the interface.

Now that you have set up your reusable interface, we can move on to creating a process model to update the employee's information.

The process model will use our reusable interface as a start form. The workflow will also include a cancel flow to end the process if the user cancels the action, and a write to data store entity smart service to save the updated employee information to our employee DSE. Then, we will add the process model as a related action to our record type and make it available from the Summary view.

When we are finished, we will have a process model that looks like this:

screenshot of completed Update Employee process model: contains a start form, XOR gateway, write to DSE smart service and an end node.

If you need more information or if you haven't created a process model before, check out the Process Model Tutorial or Appian Academy Online's course for help.

Create a process model and set a start form

To create a process model and set a start form:

  1. In the application view, click NEW > Process Model.
  2. For Name, enter AT Add or Update Employee.
  3. For Save In, keep the default, AT Models.
  4. Click CREATE.
  5. In the Review Process Model Security dialog, keep the default security groups:
    • Permissions for Default (All Other Users) should be set to No Access.
    • Permissions for AT Users should be set to Viewer.
    • Permissions for AT Administrators should be set to Administrator.
  6. Click Add Users or Groups.
  7. In the new box, enter AT Managers.
  8. From the Permission Level dropdown list, select Initiator. This permission level will allow managers to start the process we're configuring.
  9. Click SAVE. The process modeler opens in a new tab and displays the new process.

Once inside the process modeler:

  1. Go to File > Properties. The Process Model Properties dialog opens.
  2. Go to the Process Start Form tab.
  3. In Interface, enter: AT_createEditEmployee
  4. When asked if you want to Create Process Parameters to match your interface's inputs, click YES. This adds the rule inputs from our interface into the process model.

    /configure-start-form-tutorial

  5. Click OK.

Create a cancel flow

Creating a cancel flow is a best practice because cancel and submit buttons are configured in the same way. This means that without a cancel flow, the information in the form will be submitted and written to the DSE even if the user wanted to cancel the action.

To create a cancel flow:

  1. From the palette on the left, drag and drop an XOR gateway onto the connector line between the Start Node and End Node.
  2. From the palette, drag an End Event node to the bottom of the XOR node. A red dot appears indicating that these two nodes will be connected.
  3. Drop the End Event node. The two nodes are now connected.
  4. Click the End Event label and enter Update Canceled.
  5. Double-click the XOR gateway to open the node.
  6. In the Name field, enter Cancel Update?
  7. Click the Decision tab.
  8. Click NEW CONDITION. We're setting a condition so that, if the cancel process variable is true, the process flows to the "Update Canceled" node.
  9. In the condition, click Expression Editor .
  10. Enter pv!cancel to reference the process variable cancel.
  11. Click SAVE AND CLOSE. The condition is already automatically set to is True.
  12. From the Results dropdown list, select Update Canceled.
  13. For the Else if no rules are TRUE condition, select End Node.

    screenshot to show decision configuration

  14. Click OK.

Add a Terminate Process event

When a process has multiple end nodes, the different branches of a process remain active until each active path reaches one of the multiple end nodes. To stop all branches of a process, even those that have not yet reached an end node, you can add a Terminate Process event to each end node.

To add a terminate process event:

  1. Double-click the End Node to open it.
  2. Go to the Results tab.
  3. Click the Terminate Process link. A Terminate Process row is added to the End Events list.

    /terminate-process-tutorial

  4. Click OK.
  5. Repeat these same steps for the Update Canceled node.

Configure the Write to Data Store Entity node

To add our data in the first few steps in this tutorial, we used the Write to Data Store Entity smart service as a function in an interface. Here, we are using the same Write to Data Store Entity smart service as a node in the process model to save our data to the DSE from the start form.

To add and configure a Write to Data Store Entity smart service node:

  1. Drag and drop a Write to Data Store Entity node between the Cancel Update? gateway and the End Node.
  2. Double-click the Write to Data Store Entity node to open it.
  3. In the General tab, for Name, enter Write to AT Employee DSE.
  4. Go to the Data tab.
  5. In the Inputs tab, click Data Store Entity.
  6. For Value, use the search feature to find your data store and select your employee entity.
  7. Click + New Input.
  8. For Name, enter employee.
  9. For Type, use the search feature to find and select your employee CDT.
  10. For Value, select pv!AT_Employee.

    /tutorial-configure-write-to-dse-node

  11. Click OK

Add activity chaining

Now that we have our process model almost complete, we are going to add activity chaining.

Activity chaining allows the process to move quicker between nodes by chaining them together. We are going to add activity chaining between the start form and the Write to Data Store Entity node so that after updating the employee information on the Summary view, the fields will be updated without having to refresh the page.

Activity chaining is usually used between multiple user input tasks and between user input tasks and write to data store entity nodes. Overusing activity chaining outside of these cases could slow down process performance.

To add activity chaining:

  1. Right-click the connecting line between the Start Node and the Cancel Update? node.
  2. In the context menu, select Enable Activity Chaining.
  3. Right-click the connecting line between the Cancel Update? and Write to AT Employee DSE nodes.
  4. In the context menu, select Enable Activity Chaining.

Test your process model

You are now ready to save, publish, and test your process model.

To save and test your process:

  1. Go to File > Save & Publish.
  2. Go to File again and select Start Process for Debugging to test the process.
  3. Add test data to the Add New Employee form.
  4. Click SUBMIT on the form. The Monitoring view of the process appears.
  5. Click the Refresh icon in the process model toolbar to see each step of the process model complete.

    /test-process-model-records-tutorial

  6. Close the Monitoring view.
  7. Go to File > Start Process for Debugging to test the cancel flow.
  8. Click CANCEL on the form. The Monitoring view of the process appears.

    /test-process-model-records-tutorial-cancel

  9. Close the process modeler.

Now that we have the interface and process model working, we will return to the record type to set up the related action.

To add your process model as a related action:

  1. Return to the AT Employee record type.
  2. On the left navigation menu, click Record Actions.
  3. Click Configure a record action manually.
  4. Under Related Actions, click CONFIGURE NEW ACTION MANUALLY. The Create New Related Action dialog appears.
  5. For Display Name, enter Update Employee.
  6. For Icon, search for the pencil icon.
  7. For Process Model, enter AT Add or Update Employee. The process parameters will automatically populate in the Context expression editor.
  8. In the AT_Employee parameter, enter rule!AT_getEmployeeById(id: rv!identifier) in place of null.
  9. Keep the cancel parameter as the default value null.

Since we don't want everyone to be able to update the employee information, we are going to make sure that only those in the manager group are able to access this related action. To only allow the managers group to view the action, we'll create a constant to point to that group and use that in our visibility expression.

To set visibility for the related action:

  1. In the Create New Related Action dialog, scroll down to the Visibility field.
  2. In the Visibility expression field, click Create Constant Create constant icon.
  3. For Name, enter AT_MANAGERS_GROUP.
  4. For Type, select Group.
  5. For Value, enter the AT Managers group.
  6. In the Application, enter Appian Tutorial.
  7. In the Save In field, enter AT Rules & Constants.
  8. Click CREATE.
  9. In the Visibility expression field, replace the existing expression with the following expression:

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

    The combination of these two functions with the group constant checks to make sure that the logged in user that is trying to access the related action is a member of the managers group.

  10. Click OK.
  11. Click SAVE CHANGES.

The fully configured related action will look like this:
screenshot of related action tab to show all parameters

Now we will add our related action to the Summary view so that users can update employee information while viewing the employee summary.

To add the related action to the Summary view:

  1. On the left navigation menu, click Views and Header.
  2. Click next to the Summary view.
  3. Under Related Action Shortcuts, select the Update Employee checkbox.
  4. Under Open Actions In, leave the default selection of DIALOG BOX.
  5. Click OK.
  6. Click SAVE CHANGES.
  7. To preview the related action, click List on the left navigation menu and open the link under URL. The record list will open in Tempo.
  8. From the record list, select an employee to view their Summary view.

    screenshot of the employee summary view in the record type with the update employee related action button added to the record view

You have successfully completed all the steps to create a record type! The next step is optional and it walks you through how to add a record list action to your record type.

Additional Steps

Add a process model to your record type as a list action

This step will show you how to connect a process model to your record type as a record list action. Record list actions are used to create new records and are accessible from the record list.

We will use the process model that we just created for our related action as our list action. We can use this process model to add new employees because the reusable AT_createEditEmployee interface is our start form. The interface will evaluate whether or not there is an existing record and determine if the process needs to update a record or add a new one to the employee record type.

Add a record list action

To add a record list action:

  1. Return to the AT Employee record type.
  2. On the left navigation menu, click Record Actions.
  3. Under Record List Actions, click CONFIGURE NEW ACTION MANUALLY. The Create New Action dialog appears.
  4. For Display Name, enter New Employee.
  5. For Icon, keep the default plus icon.
  6. For Process Model, enter AT Add or Update Employee.
  7. For Visibility, replace the existing expression with the following:

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

  8. Click OK.
  9. Click SAVE CHANGES.
  10. To preview the record list action, click List on the left navigation menu and open the link under URL. The record list will open in Tempo.

screenshot of configured record list with user filter and list action

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!

Open in Github Built: Mon, Nov 29, 2021 (03:22:32 PM)

On This Page

FEEDBACK