Free cookie consent management tool by TermsFeed

a!gridField_25r3 Component

On This Page

This page contains information related to an old version of the Read-Only Grid Component.

To take advantage of the latest features and improvements, we always recommend you use the latest version whenever possible. For what's changed, see New version details.

Function

a!gridField_25r3( label, labelPosition, instructions, helpTooltip, emptyGridMessage, data, columns, pageSize, initialSorts, secondarySorts, pagingSaveInto, selectable, selectionStyle, selectionValue, selectionSaveInto, selectionRequired, selectionRequiredMessage, disableRowSelectionWhen, validations, validationGroup, showWhen, spacing, height, borderStyle, shadeAlternateRows, rowHeader, accessibilityText, refreshAlways, refreshAfter, refreshInterval, refreshOnReferencedVarChange, refreshOnVarChange, userFilters, showSearchBox, showRefreshButton, showExportButton, recordActions, openActionsIn, actionsDisplay, actionsStyle, maxSelections, showSelectionCount, loadDataAsync, similarityScoreThreshold )

Displays a grid of data as rich text, links, images, buttons, tags, record actions, or progress bars. This grid component also supports searching, filtering, selecting, sorting, and paging. For example:

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

See also:

Parameters

Note:  Not all parameters are immediately available in design mode; some display only after enabling others. For example, after selecting Selectable, other selection-related parameters will be available.

Name Keyword Types Description

Label

label

Text

Text to display as the grid label.

Label Position

labelPosition

Text

Determines where the label appears. Valid values:

  • ABOVE (default) Displays the label above the component.
  • ADJACENT Displays the label to the left of the component.
  • COLLAPSED Hides the label. The label will still be read by screen readers; see accessibility considerations for more information.
  • JUSTIFIED Aligns the label alongside the component starting at the edge of the page.

Instructions

instructions

Text

Supplemental text about this grid.

Help Tooltip

helpTooltip

Text

Displays a help icon with the specified text as a tooltip. The tooltip displays a maximum of 500 characters. The help icon does not show when the label position is "COLLAPSED".

Empty Grid Message

emptyGridMessage

Text

Text to display in the grid when no data is available. Default is "No items available".

Data Source

data

recordType, List of Map and List of Dictionary, DataSubset, or PortalReportDataSubset

The data to display in the grid. Use a record type reference or a!recordData() to source your data from records and utilize records functionality, such as user filters and export to Excel. For other cases, you can use a query, such as a!queryEntity() with pagingInfo set as fv!pagingInfo to have the grid automatically manage paging. The function a!queryProcessAnalytics(), a Data Subset, a list of Dictionary, or an array of data can also be used. When using a query that returns a datasubset, you must pass the total count (fetchTotalCount: true on the query).

Columns

columns

List of a!gridColumn()

The columns to display in the grid, configured using a!gridColumn().

Rows to Display Per Page

pageSize

Number (Integer)

The maximum number of rows to display at a time. Default: 10

Initial Sorts

initialSorts

List of SortInfo

Sorts applied to the grid upon initial load only. Each sort is applied in the order listed. The first sort in the list will display an active-sort arrow indicator (either up or down for ascending or descending) in its corresponding grid column (if applicable).

Secondary Sorts

secondarySorts

List of SortInfo

Sorts applied to the grid after every user interaction. If the user activates a sort on a column, these sorts will be applied to the other columns in the order they're listed. For example, adding a secondary sort on Month will keep them in order when the user sorts on Year. Secondary sorts do not display an active-sort indicator.

Paging Save Into

pagingSaveInto

List of Save

One or more variables that are updated only when user invokes a paging action on the grid. You can reference the current paging of the grid using fv!pagingInfo.

Selectable

selectable

Boolean

Determines if grid rows are selectable. When selection style is "CHECKBOX" (default), the selection column is displayed. Default: false.

Selection Style

selectionStyle

Text

Determines the style when a row is selected. Valid values: "CHECKBOX" (default), "ROW_HIGHLIGHT".

Selection Value

selectionValue

Text Array or Integer Array

Identifiers of the rows that should appear as selected. Can be set to have rows be pre-selected for the user. Supported types: Text Array and Integer Array.

Save Selection To

selectionSaveInto

List of Save

One or more variables that are updated with the selected identifiers when the user changes selections. Use a!save() to save a modified or alternative value to a variable. You can reference the rows selected and deselected in the most recent user interaction (not all selected or deselected rows) using fv!selectedRows and fv!deselectedRows respectively.

Selection required

selectionRequired

Boolean

Determines if a selection is required to submit the form. Default: false.

Selection Required Message

selectionRequiredMessage

Text

Custom message to display when a selection is required and not provided.

Disable Row Selection

disableRowSelectionWhen

Boolean

Determines for each row if selection is disabled. The condition defined in this parameter is evaluated once for each row. Reference fields from the source using dot notation, such as fv!row.status, or the identifier of the row using fv!identifier. Grids that use record data must use the recordType! domain to reference a record field or related record field. For example, fv!row[recordType!Case.fields.caseName]. Default: false.

Validations

validations

List of Variant

Validation errors to display below the grid when the data is invalid, configured using a!validationMessage(). You can reference the current page of data using fv!currentPage.

Validation Group

validationGroup

Text

When present, the requiredness of the field is only evaluated when a button in the same validation group is pressed. The value for this parameter cannot contain spaces. For example, “validation group” is not a valid value. You need to add an underscore between words: “validation_group”. See the following recipes for more information:

Show When

showWhen

Boolean

Determines whether the component is displayed on the interface. When set to false, the component is hidden and is not evaluated. Default: true.

Spacing

spacing

Text

Determines the spacing within grid cells. Valid values: "STANDARD", "DENSE". Auto default: Uses "STANDARD" in browsers and "DENSE" in Appian Mobile.

Height

height

Text

Determines height of the grid. Valid values: "SHORT", "SHORT_PLUS", "MEDIUM", "MEDIUM_PLUS", "TALL", "TALL_PLUS", "EXTRA_TALL","AUTO" (default). All grid heights besides AUTO have fixed headers that will remain at the top of the grid when scrolling.

Border Style

borderStyle

Text

Determines the style of the grid border. Valid values: "STANDARD", "LIGHT" (default).

Shade Alternate Rows

shadeAlternateRows

Boolean

Determines whether alternate rows are shaded. Default: false.

Row Header

rowHeader

Number (Integer)

Index of the column to be used as the row header. Screen readers will announce the value in each row header when navigating to other cells within that row. Used only for accessibility; produces no visible change.

Accessibility Text

accessibilityText

Text

Additional text to be announced by screen readers. Used only for accessibility; produces no visible change.

Refresh after each user interaction

refreshAlways

Boolean

When true, grid data will be refreshed after each user interaction and each interval refresh. Default: false.

Refresh after record action completes

refreshAfter

List of Text String

Refreshes grid data each time a specified action completes. Valid values: "RECORD_ACTION".

Refresh after an interval of time

refreshInterval

Number (Decimal)

How often grid data gets refreshed in minutes. When null, grid data will not be refreshed on an interval. Valid values: "0.5", "1, 2", "3", "4", "5", "10", "30", and "60".

Refresh after referenced variable changes

refreshOnReferencedVarChange

Boolean

When true, grid data will be refreshed each time the value of any variable referenced in the data parameter is updated. To refresh grid data when another variable that is not used in the data parameter changes, use refreshOnVarChange. Default: true.

Refresh after variable changes

refreshOnVarChange

Any Type

Refreshes grid data each time any of these specific variables change. This allows you to refresh the grid data when a variable that is not referenced in the data parameter is updated. You can define a single variable (e.g. refreshOnVarChange: local!var1) or a list of variables (e.g. refreshOnVarChange: {local!var1, local!var2}).

User Filters

userFilters

List of Variant

List of user filter references to display, configured using the recordType! domain. For example, recordType!Case.filters.status. You may only reference user filters defined on the source record type used for the grid data. This parameter only applies when a record type is used as the source in the data parameter.

Show search box

showSearchBox

Boolean

Determines if the record search box should be shown. This parameter only applies when a record type is used as the source in the data parameter. Default: true.

Show Refresh Button

showRefreshButton

Boolean

Determines if the grid should include a refresh button to manually refresh data. This parameter only applies when a record type is used as the source in the data parameter. Default: true.

Show Export to Excel Button

showExportButton

Boolean

Determines if grid data can be exported. This parameter only applies when a record type is used as the source in the data parameter. Default: false.

Record Actions

recordActions

List of Variant

List of record action items to display above the grid, configured using a!recordActionItem(). If you use fv!identifier in the identifier parameter of a!recordActionItem(), you will also need to configure selection for the grid. This parameter only applies when a record type is used as the source in the data parameter.

Open Actions In

openActionsIn

Text

Determines how record actions should open to the user. Valid values: "DIALOG" (default), "NEW_TAB", "SAME_TAB".

Actions Display

actionsDisplay

Text

Determines which details are shown for record actions, regardless of style. Valid values: "LABEL_AND_ICON" (default), "LABEL", "ICON".

Actions Display

actionsStyle

Text

Determines how the list of actions should be displayed above the grid. Valid values: "TOOLBAR" (default), "TOOLBAR_PRIMARY". Learn more.

Maximum Selections

maxSelections

Number (Integer)

The maximum number of items the user can select. When the user selects the maximum number of items, row selection is disabled.

Show Selection Count

showSelectionCount

Text

Determines when the number of selected items displays below the grid. Valid values: "AUTO" (default), "ON", "OFF". "AUTO" displays the selection count if the value of the maxSelections parameter is greater than 1.

Load Grid Data in Background

loadDataAsync

Boolean

When a record type is used as the grid's data source, set this to true to load the grid data and filters independently from the rest of the interface. To asynchronously load data that is used in other components as well, instead of setting this to true, use a!asyncVariable to define a local variable and use the local variable in the data parameter. See Asynchronous Loading for more information. Default: false.

Similarity Score Threshold

similarityScoreThreshold

Number (Decimal)

When smart search is available, it returns records that match the user's search for fields with smart search enabled, as long as they appear in the grid and meet or exceed the similarity score. Default: 1. A value of 1 means that only keyword matches will be displayed.

Usage considerations

Choosing the source of the grid

The fastest way to configure a read-only grid is from design mode. When you drag and drop the component into the live view, you can select one of the following options as the grid's data source:

Data Source Action
Record type Select a record type to use as the source. Grids that use a record type as the source are referred to as a records-powered grids.

When you select a record type as the data source, the grid will populate with the record list configured on the record type. You can also reuse other elements from the record type.
Query Create an a!queryEntity() expression from the query editor and use the resulting query as the source.
Variable Select a rule input or local variable as the source.
Rule Select an expression rule to use as the source.
Expression Write an expression directly in the component to use as the source.

Using records-powered grids

Consider the following when creating a records-powered grid.

Using records-powered grids in a portal

When you use a records-powered grid in a portal, there are a few things to keep in mind:

  • Some record components don't work in portals: Certain record components, such as record links and record actions, are incompatible with portals. When you create a read-only grid using a record type, it may automatically use these components, so be sure to remove the incompatible components before publishing your portal.
  • Users can't save their filters in a portal: The record list search, refresh button, export to Excel, and user filters will all function in a portal. However, users can't save their filters in a portal since they aren't signed in. The Manage filters button is replaced with a Clear Filters button in a published portal.
  • Asynchronous loading is not compatible with portals.

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closefilters in read only grid filters

See Working with Data in Portals for more information about using records as the source for read-only grids in portals.

Autopopulate a grid with a record list

When a record type is used as the data source for your read-only grid, Appian automatically generates grid columns based on the columns configured for the record list.

Specify which fields to query and when

By default, a grid will query and display all the data specified in the columns, pagingSaveInto, and selectionSaveInto parameters. This default behavior can potentially impact performance if your grid includes dynamic behavior since it may result in querying more data than necessary.

For example, let's say you configured the showWhen parameter on the columns in your grid so that certain columns only appear to managers. Even when columns are hidden from the grid, those fields will still be queried since they're specified in the columns parameter of the grid.

To alter this default behavior, you can specify when the grid should query the fields in your columns using the fields parameter in a!recordData(). Learn more about using the fields parameter in a!recordData().

If you use a record type with data sync enabled as the source of your grid, you can also reference related record fields in your grid.

You can use related record fields in your columns, or to sort and filter the grid.

If you reference a related record field from a one-to-many relationship as a column in the grid, the maximum number of related records returned for each base record is 100.

To filter, limit, and sort the related record set returned from the one-to-many relationship, you can leverage the relatedRecordData parameter in a!recordData().

Avoid using relationship references to display related one-to-many data. Instead, you should only reference the specific related record field you want to display. This avoids querying more data than necessary, which can impact the grid's performance and export behavior.

For example, to display a list of cases associated with each customer, you should use the related record field reference recordType!Customer.relationships.cases.fields.title in the grid column. You should not use the relationship reference recordType!Customer.relationships.cases.

Use records-specific components

You can display the following components on any records-powered grid:

Export data to Excel

When set to true, the showExportButton parameter allows users to export the grid data to Microsoft Excel. By default, any columns visible in the grid will export to Excel. You can specify which columns are exported by configuring the exportWhen parameter on individual grid columns.

Users should only export grid data from applications and sites. You should not export grid data from an interface in Appian Designer.

Review how much data can be exported from the grid, and how certain display elements are exported to Excel.

Display and style record actions

The recordActions parameter allows you to display record actions, like related actions or record list actions, on the grid. You can display actions from different record types.

You can then use the actionsStyle parameter to determine whether all actions display as with standard styling, or if the first record action displays as a primary button style. Appian recommends using the "TOOLBAR_PRIMARY" option when you want the first action, typically the most common action, to stand out.

When actionsStyles is set to "TOOLBAR", the buttons display like this:

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/grid-toolbar-standard.png

When actionsStyles is set to "TOOLBAR_PRIMARY", the buttons display like this:

Scroll or drag to pan · ⌘+/⌘− to zoom · Esc to closeimages/grid-toolbar-primary.png

See the record action component for other details to consider when adding record actions to a grid.

Record action security

Each action specified in the recordActions parameter has security that is checked to ensure only the right users can see the right actions. In most cases where you use security rules, Appian evaluates the security for the entire grid before it is shown to the user. Because security rules are verified in bulk, the overall grid loading time will be shorter than if security expressions are used.

Note:  If you use a!localVariables() inside an a!recordActionItem(), Appian cannot perform a bulk security evaluation, so the grid may load slower than expected. Whenever possible, create local variables outside a!recordActionItem().

Row limit for records-powered components

Interface components that use a record type as the data source are known as records-powered components.

Records-powered components can display a maximum of 5,000 rows. As a best practice, you should not display all 5,000 rows in a component since it may impact performance.

Using the loadDataAsync parameter

When you use a record type as the grid's data source, you can set the loadDataAsync parameter to true to allow the interface to load without waiting for the grid data. A placeholder will display in the grid's place, enabling users to interact with other parts of the interface while the grid's data loads in the background.

If the grid's data is reused elsewhere in the interface, consider using a!asyncVariable() to create an async variable instead. See Asynchronous Loading for more information on choosing the right method.

Note:  In offline mobile and portal interfaces, read-only grids that are configured to load asynchronously will load with the rest of the interface, instead of loading in the background.

If you are querying data directly in the data parameter of the read-only grid, you can still use the loadDataAsync parameter. However, it is typically simpler to just use an async local variable for the grid data.

Configuring grid display

  • If the value for a column is empty or null, the grid still renders the column with just the label.
  • The selectionStyle of ROW_HIGHLIGHT does not have any visual indicator when selection is disabled through the disableRowSelectionWhen parameter.
  • For accessibility purposes, every grid should have a row header configured. The first column containing text is usually the correct choice for row header. See the SAIL Design System for more information.

Configuring grid paging

  • To reduce clutter on smaller grids, the following happens:
    • No paging controls are displayed when all rows are on one page.
    • Paging controls to jump to the first or last page are not displayed when a grid has less than 3 pages.
  • When a read-only grid is used offline, paging and sorting don't function and images won't render.
  • If you are managing your own paging, you cannot pass a datasubset which has a paging configuration that uses a batch size of -1.
  • When entering a query in the data parameter (either directly, or indirectly from a rule reference), the query must return the total count (fetchTotalCount: true).

Grid height and column width

  • Grid heights behave as a fixed height on web but a maximum height on mobile.

  • For columns using the "AUTO" width, each column's width is determined by the length of the longest value in that column.

Design mode guidance

Note:  This guidance does not apply to grids that use a record type as the data source. See Configuring the Read-Only Grid to learn how to configure a records-powered grid in design mode.

The following guidance applies when configuring a read-only grid in design mode:

  • Generated columns:
    • When you populate the data parameter from design mode and let the grid manage the paging, the grid will automatically generate an initial set of columns in the order they appear.
    • Grid columns are not automatically generated when you select VARIABLE as the data source and use a local variable to power the read-only grid.
    • The initial values for automatically-generated columns are:

      Parameter Value Description
      label fv!row.<fieldname> The field name is converted to title case. If the field name is in camel case, it will be split and converted to title case. If the field name is too long, it will be truncated with ellipses (...).
      value fv!row.<fieldname> The field value to display.
      sortField <fieldname> The field name of the primary key.
      align "END" or fixed() The alignment depends on the field's data type. If the data type for the column value is numerical or date-based, then it will set align : "END". If the data type for the column value is a decimal, then it will be wrapped in the fixed() function to two decimal places. Ex. value: fixed(fv!row.cost, 2).
  • Updating columns:
    • After initial columns have been generated, the grid will automatically update with new columns to match any new fields added to the data source.
    • However, automatic updates do not occur when the data source is an RULE or EXPRESSION. To update the columns displayed in the grid, you must update the data source, and add or remove the columns manually.
  • Selecting QUERY as the data source:
    • If you select QUERY as the data source, you'll use the query editor to configure the query that powers your grid.
    • Appian will automatically use the following query values in your grid:
      • The query's batchSize will be the value of the grid's pageSize parameter.
      • The query's sortInfo will be used as the grid's initialSort parameter.
  • Batch size limitation:
    • The grid cannot use a query that has a paging info with a batch size of -1 in design mode.

You can use smart search across multiple text fields or a document field in a grid.

To use smart search in a read-only grid:

  1. Enable smart search for Text or Document fields on a synced record type.
  2. In an interface, add a Read-Only Grid component and set the source to your record type.
  3. In the read-only grid, ensure the showSearchBox parameter is set to true.
  4. For the similarityScoreThreshold parameter, change the value to less than 1. For example: 0.5. This will allow the grid to use both keyword search and semantic search. If you leave this parameter at 1, then only keyword search is applied.
  5. (Optional) Add an initial sort on recordType!<Record Type Name>.searchResults.allSearchFields.similarityScore in descending order so the best matches appear first. This sort is ignored when no search term is entered and applies only after a user starts a search.

Tip:  If you're using a custom search box to filter the grid instead of the default search box, you can still use smart search in your grid.

Search behavior in a!gridField

Tip:  Grids use a keyword search by default because the similarity score threshold defaults to 1. To enable smart search, lower this value.

By default, the search box in a read-only grid uses a keyword search to find exact matches to a user's search terms. You can implement semantic search in this default search box, or by building a custom search box for the grid.

Depending on which search box you’re using, the way you implement semantic search and how it behaves will differ:

Primary similarity score

When you search across multiple fields, a row may have several search matches. The highest similarity score found in that row is called the primary similarity score. Use the primary similarity score to filter and sort data by the strongest search matches, regardless of which field contained the match.

For example, if smart search is enabled on the title, description, and name fields, a semantic search for "electrical outage" in a read-only grid evaluates all three fields. To ensure users see the most relevant results first, sort the grid by the primary similarity score.

Title Field Description Field Name Field Primary Similarity Score
Power Out

Similarity Score: 0.6
A tree took out the electrical in our house.

Similarity Score: 0.7
Donna Jones

Similarity Score: null
0.7
Request for more Disk Space

Similarity Score: null
Our system requires more RAM storage.

Similarity Score: null
James Powers

Similarity Score: 0.2
0.2
Electrical is down

Similarity Score: 0.8
The power went out at 3:00 PM this morning.

Similarity Score: 0.7
Jane Doe

Similarity Score: null
0.8

Note:  When you combine semantic and lexical search in the same query, a row that matches both operators appears only once. The lexical score always becomes the primary similarity score because it's the higher value. See Combining semantic and lexical search to learn more about this behavior.

Sorting by similarity score

You can sort a read-only grid by similarity score to show the most relevant search matches first.

When you sort by similarity score, you must also configure a secondary sort. The secondary sort determines the grid's order when a user has not entered a search term, which means the similarity score is null.

To sort the grid by the highest similarity score:

  1. In the initialSorts parameter of the read-only grid, define an array {} containing two a!sortInfo() functions.
  2. In the first a!sortInfo() function, configure the following:
    • For field, enter recordType!<Record Type Name>.searchResults.allSearchFields.similarityScore. This will sort by the primary similarity score.
    • For ascending, enter false. This will sort from highest to lowest similarity score, placing more relevant results first in the list.
  3. In the second a!sortInfo() function, choose a field to sort by when the grid first loads or when the search box is empty.

    For example:

1
2
3
4
5
6
7
8
9
10
11
12
  initialSorts: {
    /* Sorts by similarity score in descending order if there is a search */
    a!sortInfo(
      field: recordType!SSTA Case.searchResults.allSearchFields.similarityScore,
      ascending: false()
    ),
    /* Defaults to sorting by id field when there is no search */
    a!sortInfo(
     field: recordType!SSTA Case.fields.id,
     ascending: true
    )
  },
  • Verify the fields you want to search are enabled for smart search.
  • Make sure the smart search indexing status is Completed and not Failed or Running.
  • Search time increases as the number of records and searchable fields grows. To improve performance, limit the number of fields and records being searched when possible. For example, searching 10,000 records is faster than searching 1 million records.
  • Use allSearchFields.similarityScore whenever possible to sort and filter. Only use <<fieldName>>.similarityScore if your use case requires it. This field behaves like related records and may return unexpected results without a search. Add logic to check for a search term first.
  • Don't filter or sort by sourceContent. sourceContent is designed to be a result of the search, not a criteria for filtering or sorting.

Examples

You can find example configurations of the grid at Configuring the Read-Only Grid and Grid Tutorial.

New version details

The read-only grid component was evolved to support a simplified similarity score range for smart search. This evolution ensures that the simplified score range is applied when smart search is implemented on the default search box or in a custom search box built for the grid.

The similarity score's decimal distribution was rescaled for greater clarity, moving from granular values (like 0.0026) to a more intuitive and readable range (like 0.4).

When updating to the latest function version, use our general guidance for interpreting similarity scores as a starting point. You'll need to test smart search with your data to determine what makes a score meaningful for your use case.

For example, if you previously used a similarity score of 0.0026 for the similarityScoreThreshold, you will need to experiment with the updated scale. You may try a score of 0.6 but it may not return enough results, so you might try a value of 0.4 to return more results instead. The significance of a similarity score will vary across data and use case.

Feature compatibility

The table below lists this component's compatibility with various features in Appian.
Feature Compatibility Note
Portals Compatible
Offline Interfaces Compatible
Sync-Time Custom Record Fields Incompatible
Real-Time Custom Record Fields Incompatible

Custom record fields that evaluate in real time must be configured using one or more Custom Field functions.

Process Reports Incompatible

Cannot be used to configure a process report.

Process Events Incompatible

Cannot be used to configure a process event node, such as a start event or timer event.

Process Autoscaling Incompatible

Cannot be used in autoscaled processes.

Event Consumer Filter Conditions Compatible

Can be used in filter conditions.

Event Consumer Event Handlers Compatible

Can be used in event handler expressions.

Feedback