Free cookie consent management tool by TermsFeed

Reference a Record Type in your Applications

On This Page

Overview

You can directly reference the record type object in your expression or interface using the recordType! domain. This domain prefix is a direct object reference that removes the need to create a constant to reference your record type.

Using a record type reference, you can reference fields, relationships, user filters, and record actions configured in the record type for use in an expression, interface, or process model.

This page describes how to reference a record type and its related properties throughout your applications.

Reference a record type

You can use the recordType! domain to reference a record type in functions, like a!queryRecordType() and a!urlForRecord(), and components, like the Record Link component or the Record Picker component.

For example, recordType! is used to reference the Case record type in the a!queryRecordType() function to return data from select record fields and related record fields.

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/record_type_queryrecordtype_function_example.png

It's easy to construct your record type references since the recordType! leverages typeahead to suggest a selection of existing record types. If you already know the name of your record type, you can even skip entering the domain and simply type the name of the record type for the domain and record type object reference to appear.

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/typeahead-records.gif

Note:  If you are unable to reference a specific record type, make sure that you have Viewer permission to the record type.

The record type object reference combined with . dot notation allows you to directly access properties of the record type like fields, actions, filters, and relationships in your functions or expressions.

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/record_type_employee_fields_lozenge_autosuggest.png

You can reference any of the record type properties in an interface or expression. We'll discuss how to reference each record property in the subsequent sections.

Reference record fields

The fields property allows you to reference any record field configured in the record type. If your record type has data sync enabled, this includes custom record fields.

You may use record field references in a query to return specific field values, or in an interface component to display record field values in a report.

To reference a record field:

  1. Enter the recordType! domain and select your record type.
  2. Enter . after recordType!<Record Type Name> to autosuggest the record type properties.
  3. Select fields to access the hierarchical menu of record fields configured in the record type.
  4. Select a record field from the dropdown to append to the fields property.

    For example, the reference below refers to the closedon field on the Case record type.

    Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/record_type_employee_fields_lozenge_firstname.png

When referencing a record field in a process variable, activity class parameter, rule input, or record variable, you can use dot notation to index into your selected field. Appian will then automatically format the field reference as needed.

For example, if you have a rule input of type record data type, you can reference individual record fields by using dot notation (.) to index into the rule input and select a record field or related record field. The field reference will be automatically wrapped in brackets.

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/autocomplete.gif

When you highlight a record field from the dropdown, Appian automatically provides additional information about the record field key, including:

  • Full record type field reference.
  • Field name.
  • Field data type.

When using a record type field reference, Appian will automatically shorten the reference to improve the readability of your expressions. To display the full reference, simply hover over it.

Reference record field properties

Through the fields property, you can also reference record fields properties

Property Example Reference
Record field description recordType!<Record Type Name>.field.<record field name>.properties.displayName
Record field display name recordType!<Record Type Name>.field.<record field name>.properties.description

To reference record field properties:

  1. Enter the recordType! domain and select your record type.
  2. Enter . after recordType!<Record Type Name> to autosuggest the record type options.
  3. Select fields to access the hierarchical menu of record fields configured in the record type.
  4. Select a record field from the dropdown to append to fields
  5. Enter . after you've selected a field to autosuggest the record field metadata.
  6. Select properties to reference either the record field display name or description.
    • Select description to display the record field's description.
    • Select displayName to display the record field's display name. screenshot showing the reference for record field metadata and UIs

Note:  Record field properties like display name and description are only available for database-backed records with data sync enabled.

To learn more about best practices for configuring reusable validations for your record fields, see Build Best Data Fabric.

Reference record field interfaces

Through the fields property, you can also reference reusable user interfaces associated with the record field.

UI Example Reference
Record field UIs to use in read-only interfaces recordType!<Record Type Name>.field.<record field name>.ui.input
Record field UIs to use in input interfaces recordType!<Record Type Name>.field.<record field name>.ui.readOnly

Unlike other record type field references, the references for reusable record field UIs require a rule input of the record type you are referencing. The rule input should directly follow the record type field reference. For example: recordType!<Record Type Name>.field.<record field name>.ui.readOnly(ri!record).

To reference reusable record field UIs:

  1. Add the record type you want to reference as a rule input to the interface.
  2. Enter the recordType! domain and select your record type.
  3. Enter . after recordType!<Record Type Name> to autosuggest the record type options.
  4. Select fields to access the hierarchical menu of record fields configured in the record type.
  5. Select a record field from the dropdown to append to fields.
  6. Enter . after you've selected a field to autosuggest the record field metadata.
  7. Select ui to reference either the record field user interface for read-only interfaces or for input interfaces.
    • Select input to call the input user interface for the record field.
    • Select readOnly to call the read-only user interface for the record field. screenshot showing the reference for record field metadata and UIs
  8. Call the record type rule input in parentheses directly after the UI reference.
    • For example: recordType!Employee.fields.email.ui.input(ri!record). screenshot showing the rule input with the field reference

Here's an example of what a form calling the reusable interfaces for multiple record fields might look like:

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeScreenshot of the expression and preview for a form that uses the reusable record fields UIs

To learn more about best practices for configuring reusable interfaces for your record fields, see Build Best Data Fabric.

Note:  Record field reusable UIs are only available for database-backed records with data sync enabled.

Reference a relationship

The relationships property allows you to reference related record fields from any relationships defined on your record type. You can also use this property to index into relationships defined on your related record types so you can select fields from record types that are not directly related to the base record type.

You may reference a record type relationship in a query to return related record data, or in an interface component to display related record data among your record fields (like in a grid or chart).

To reference related record fields from a record type relationship:

  1. Enter the recordType! domain and select your record type.
  2. Enter . after recordType!<Record Type Name> to autosuggest the record type properties.
  3. Select relationships to access the hierarchical menu of record type relationships configured in the record type.
  4. Select a relationship from the dropdown to append to the relationships property.

    Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/record_type_order_lozenge_customer_relationship_details.png

  5. Enter . after the recordType!<Record Type Name>.relationships.<Relationship Name> to autosuggest the fields and relationships property on the related record type:
    • Select fields to select a related record field.
    • Select relationships to index into the relationships available on the related record type.

      For example, the reference below refers to the accountmanager field on the related record type Customer.

      Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/record_type_order_lozenge_customer_relationship_field_details.png

When you highlight a relationship from the dropdown, the following information is presented:

  • Shortened record type relationship reference.
  • Relationship name.
  • Related record type name.
  • Relationship type.
  • Full record type relationship reference.
  • Properties on the related record type that can be indexed into.

When you highlight a related record field from the dropdown, the following information is presented:

  • Shortened related record field reference.
  • Related record field name.
  • Related record field data type.
  • Full record type relationship reference.

Reference a record action

The actions property allows you to reference any record list actions or related actions defined on your record type. You may use this property to configure a Record Action component.

To reference a record action:

  1. Enter the recordType! domain and select your record type.
  2. Enter . after recordType!<Record Type Name> to autosuggest the record type properties.
  3. Select actions to access the hierarchical menu of actions configured in the record type.
  4. Select a record action from the dropdown to append to the actions property.

    For example, the reference below refers to the Update Case related record action on the Case record type.

    Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/record_type_employee_actions_lozenge_update.png

When you highlight a record action from the dropdown, Appian automatically provides additional information about it, including:

  • Full record type action reference.
  • Action description.
  • Record type name.
  • Action name.
  • Process model that supports the record action.
  • Action context.
  • Visibility setting.

When using a record type action reference, Appian will automatically shorten the reference to improve the readability of your expressions. To display the full reference, simply hover over it.

Reference a user filter

The filters property allows you to reference any user filters configured in the record type. You may use this property when adding a user filter on a read-only grid.

To reference a user filter:

  1. Enter the recordType! domain and select your record type.
  2. Enter . after recordType!<Record Type Name> to autosuggest the record type properties.
  3. Select filters to access the hierarchical menu of user filters configured in the record type.
  4. Select a user filter from the dropdown to append to the filters property.

    For example, the reference below refers to the Status user filter configured on the Case record type.

    record type employee lozenge department filter

When using a record type user filter reference, Appian will automatically shorten the reference to improve the readability of your expressions. To display the full reference, simply hover over it.

Reference record values in the record type

You often need to reference record values within the record type itself, like when configuring a record view or a related action. To do so, use the rv! domain.

The rv! domain allows you to reference record data in two ways:

  • rv!identifier: References only the record's primary key.
  • rv!record: References the entire record data structure and its relationships.

Use rv!identifier

Use rv!identifier to pass a record's identifier into an interface, expression, or process model.

This is the most performant method for configuring:

Configuring record views

When configuring a record view, using rv!identifier is a best practice for performance, especially for interfaces with conditional logic or large data requirements.

You can use rv!identifier to execute a targeted query (such as a!queryRecordByIdentifier()) within the record view configuration, so you only retrieve the data you need.

For example: The summary view interface for the Order record type displays large volumes of data from multiple record types and conditionally shows information depending on whether the customer used a discount code or purchased a certain item.

To efficiently pass record data to this interface, the record view is configured to pass record data using rv!identifier and the a!queryRecordByIdentifier() function.

You can use rv!identifier to pass a record's ID into a related action's start form. This is common when the start form contains a component (like a grid) that must be filtered to show specific record data.

For example: You have a start form where a manager provides a performance review for each employee within a grid. To filter the grid, you use a rule input like this:

1
2
3
4
5
6
7
8
9
10
11
12
a!gridField(
   data: a!recordData(
      recordType: recordType!AT Employee,
      filters: {
         a!queryFilter(
         field: recordType!AT Employee.fields.id,
         operator: "=",
         value: ri!record[recordType!AT Employee.fields.id]
         )
      }
   )
)

In the related action configuration, you can pass rv!identifier to the form's rule input. The grid on the form then uses that input to filter and display only that employee's data.

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/rv-identifiers-example.png

Use rv!record

Use rv!record when you need to reference the entire record or a specific record field.

You should use rv!record to configure:

  • Record titles.
  • Simple record views.

Note:  When you use rv!record for a record view, Appian queries all record fields and up to 100 related records for each one-to-many relationship. If your interface only displays a subset of data, or uses conditional logic to hide data, this can result in unnecessary querying and slower performance. In those scenarios, use rv!identifier instead.

For example: rv!record is used to define the Record Title so the appropriate customer name appears on each record header.

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/rv-record-example.png

Reference record data in an interface

All record type objects have their own unique data type, which is specific to each record type and automatically generated when the record type is created. The record data type allows you to easily access the data associated with a specific record type and use field references to call the record data into your expressions and interfaces.

For interfaces connected to a record type, such as record views, you can pull in record data by using the record data type as a rule input in your interface.

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/records-rule-input.png

Once you configure the rule input, you can reference your record fields in the interface by calling the rule input followed by a record field reference wrapped in brackets.

For example, the expression below uses ri!record to call the rule input containing the record data type for the Case record type. Then, the rule input is followed by a record field reference to Case record type to display the case status in a text field.

1
2
3
4
5
6
7
8
9
a!textField(
  label: "Customer",
  labelPosition: "JUSTIFIED",
  value: a!defaultValue(
      ri!record[recordType!Case.fields.status],
      "–"
      ),
   readOnly: true
),

After you configure the interface, you can add it as a record view and seamlessly pull the record data into the rule input using rv!record.

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/record-view-call-interface.png

For examples of how to use record data types as rule inputs in interfaces and views, see Create a Record View.

Reference record data in a process model

Record types can be used as variables in a process model. This allows you to use record data in your process model as a process variable or an activity class parameter.

You can use record types as process variables to manage the full lifecycle of your business data and power a variety of workflows. For example, record data can be used to:

See Create a new record using a process model for an example.

Use a record type constructor

You can use a record type constructor to create a single record in your expression. The record type constructor allows you to map each value to a particular field reference or relationship reference in the record type.

To create a record type constructor:

  1. In an expression rule, enter a record type reference followed by parentheses.

    For example: recordType!Case()

  2. In between the parentheses, enter the record field references followed by a : colon and its corresponding data value on the right.

    For example:

    1
    2
    3
    4
    5
    
    recordType!Case(
       recordType!Case.fields.id: 1,
       recordType!Case.fields.status: "Open",
       recordType!issueType: "Shipping"
    )
    
  3. If you have record type relationships, you can create related record data by referencing the record type relationship followed by a : colon and the related record type reference on the right. You'll create a nested constructor to define the related record data.

    For example:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    recordType!Case(
       recordType!Case.fields.id: 1,
       recordType!Case.fields.status: "Open",
       recordType!Case.fields.issueType: "Shipping",
       recordType!Case.relationships.customer: recordType!Customer(
          recordType!Customer.fields.firstName: "Amy",
          recordType!Customer.fields.lastName: "Smith",
          recordType!Customer.fields.title: "Manager"
       )
    )
    
  4. Click TEST RULE to view the data output.

    For example:

    /record-type-constructor-example-2-output

Feedback