Data Structures In Appian

When we encounter any tech-related topic, we immediately consider various methods for storing data to facilitate the further processing of information.

When it comes to data structures, the same principles apply. However, in the context of Appian, we have the opportunity to work with a range of advanced structures readily available to us.

In the field of data structures, it’s crucial to understand that the foundational principles remain consistent across different platforms and technologies. At its core, the fundamental concepts of data organization, storage, and retrieval are universally applicable. Nevertheless, what sets Appian apart is the accessibility to an array of sophisticated data structures that empower developers to create robust and efficient solutions. Leveraging these advanced structures within the Appian environment can significantly enhance the scalability and performance of applications, providing a competitive edge in the ever-evolving landscape of software development.

Appian requires that the data (process variables, node inputs, node outputs, rule inputs, data store entities, or constants) adhere to specific data types. This adherence is essential for seamless functionality within the platform.

The most commonly used are as follows

PagingInfo

The PagingInfo data type is used to configure paging in queries and the Read-Only Grid component. It is utilized as an argument for the todatasubset() and a!gridField() functions. To create a PagingInfo value, use the a!pagingInfo() function.

Any Type

The Any Type is a generic data type that can be used as an input for rules and certain expression functions like the if() function. It can accept data of any data type, and data is stored in variables of this type by mapping an existing variable, rule, constant, or expression to its value.

Map

The map data type is designed for storing data as associative arrays in key-value pairs, for example: a!map(key1: “value1”, key2: “value2”).

Several functions and objects can return a map, and it can also be created using the function a!map(). Moreover, the map type can be selected as a variable type in process models.

When working with a map, each key is associated with a specific value, and the type of that value is maintained, meaning the value is not wrapped as a variant.

ProcessInfo

The ProcessInfo data type is meticulously crafted to store essential details about a running process. It comprises three vital fields:

pp – This field encompasses a dictionary that holds the properties of the process, including id, name, priority, initiator, designer, start time, deadline, and timezone.

pm – Here, you will find a dictionary containing the properties of the process model at the time the process commenced. It includes id, name, description, version, creator, and timezone.

pv – This dictionary encapsulates the process variables associated with the process.

Query

The Query data type defines the grouping, aggregation, filtering, paging, and sorting configuration to be applied when querying using a!queryEntity(). It also contains several supporting data types for each of these configurations.

Selection

The content provides information about the accepted data type in the selection|aggregation field of the Query data type. This data type can include one or multiple Column data types and is utilized when selecting columns without grouping them together or applying an aggregation function.

Column

The Column data type is used with the Selection data type and includes the following fields:

Field: The data type field to retrieve. The available fields depend on the data source and its data type. Child fields of a multiple cannot be selected. If no alias is provided and the field name collides with another existing alias, an incremented digit will be appended when the field name is returned in the result.

Alias (optional): A case-sensitive short name to reference the result of the Column value in other parts of the query. If no alias is given, the alias for the column will be inferred as the field value.

Visible (Boolean, optional): Determines whether the column should be visible to end users. If set to false, the data for the column will not be retrieved but can still be used for sorting. The default value is true.

Aggregation

A confident rewrite of the content:

The “selection|aggregation” field of the Query data type accepts the AggregationColumn data type and is designed for applying functions to selected columns. It is a suitable alternative to the Selection data type when you need to perform operations on the selected columns. Supported aggregation functions include: COUNT, SUM, AVG, MIN, and MAX.

AggregationColumn

The AggregationColumn data type is only used in conjunction with the Aggregation data type.

It contains the following fields:

field – The dot-notation to the field of the data, such as a record type, you want to group together and/or aggregate. The fields cannot be complex or multiple values.

alias – The short name by which the result of the AggregationColumn value can be referenced in other places of the Query value. Values are case-sensitive.

visible (Boolean) – (Optional) Determines whether the grouping or aggregation column should be visible to end users. If false, the data for the column will not be retrieved, but it can be used for sorting. Default value is true.

isGrouping (Boolean) – (Optional) Determines whether the field should be grouped. Default value is false.

aggregationFunction – The function to use when aggregating the field. Valid values include COUNT, SUM, AVG, MIN, and MAX. This value is required when isGrouping is set to false

LogicalExpression

The data type responsible for determining the filtration to apply includes the following fields:

  • operator: This field determines the operation to apply to the set filters in the logicalExpression|filter|search value. Currently, the only valid values are AND and OR.
  • logicalExpression|filter|search: This field contains nested LogicalExpression or QueryFilter values that will be operated on based on the operator value.

QueryFilter

The data type specified here is essential for setting up the filter options for a!pickerFieldRecords, a!query, a!queryRecordType, a!recordData, and a!recordFilterListOption.

SortInfo

The SortInfo data type plays a crucial role in the sorting of data within the PagingInfo and DataSubset types. It effectively determines the arrangement of data within a subset.

To create a value of type SortInfo, use the a!sortInfo() function


Discover more from Appian Tips

Subscribe to get the latest posts sent to your email.

Leave a Reply

Up ↑

Discover more from Appian Tips

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from Appian Tips

Subscribe now to keep reading and get access to the full archive.

Continue reading