Free cookie consent management tool by TermsFeed

Read-Only Grid Column Component

On This Page
SAIL Design System guidance available for Grids

Grids should help your users take action and make decisions. Check out the grids design guidance page to learn how to display your data in a structured, easy-to-scan layout to help your users find what they need.

About the read-only grid column component

Displays a column of data as read-only text, links, images, rich text, or other components supported within the Read-Only Grid Component.

Where to use the read-only grid column component

Use a!gridColumn() in the columns parameter of a read-only grid (a!gridField()).

Supported components

The value parameter of a!gridColumn() supports only the following components:

Parameters

a!gridColumn( label, sortField, helpTooltip, value, showWhen, align, width, backgroundColor, accessibilityText, exportWhen )

Name Keyword Types Description

Label

label

Text

Text to display as the column header.

Sort Field

sortField

Any Type

The field used to sort the grid when selecting this column header. Grids that use record data must use the recordType! domain to reference a record field or related record field. For example, recordType!Case.fields.caseName.

Help Tooltip

helpTooltip

Text

Displays a help icon in the column header with the specified text as a tooltip.

Display Value

value

Any Type

The value to display in each cell within the column. The value can be text, a!imageField(), a!linkField(), a!richTextDisplayField(), a!tagField(), a!buttonArrayLayout(), a!recordActionField(), or a!progressBarField(). It is evaluated once for each row.

Reference fields from the source using dot notation, such as fv!row.status, or the identifier 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].

If you use a!recordData() to populate your grid and you specify a fields parameter, any field references that are not included in that parameter will be ignored.

Show When

showWhen

Boolean

Determines whether the column is displayed in the grid. When set to false, the column is hidden and is not evaluated. Default: true.

Alignment

align

Text

Determines the alignment for the header label and all values within the column. Valid values: "START" (default), "CENTER", "END".

Width

width

Text

Determines the column width. Valid values: "AUTO", "ICON", "ICON_PLUS", "NARROW", "NARROW_PLUS", "MEDIUM", "MEDIUM_PLUS", "WIDE", "1X", "2X", "3X", "4X", "5X", "6X", "7X", "8X", "9X", and "10X".

Background Color

backgroundColor

Text

Determines the cell background color. To set the color based on the value of the cell, use fv!row and dot notation to reference the field (such as fv!row.status). 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.status]. Valid colors: Any valid hex color or hex color including transparency, or "NONE" (default), "ACCENT", "SUCCESS", "INFO", "WARN", "ERROR". To add transparency to the hex color, add two additional digits between 00 (more transparent) and FF (less transparent).

Accessibility Text

accessibilityText

Text

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

Export When

exportWhen

Boolean

Determines whether the column is displayed in the grid on export. When set to false, the column is hidden in the exported grid. If no value is provided, the value of the showWhen parameter determines whether to export the column or not.

Using the read-only grid column component

The following sections cover important details about the read-only grid column component.

Using the value parameter

If the value parameter… Then…
Is null or empty The grid will render the column with only the label.
Is a relationship reference The column will not display any data. Instead, reference a specific related record field in this parameter to display related data in a column. For example, recordType!Order.relationships.customers.fields.fullName.

Avoid using a query directly in the value parameter since it will cause the query to run for each row in the grid. Instead, you can use a records-powered grid to easily reference data from a record type and any of it's related record types.

When configuring the component, click Display Options after choosing a value.

Grid column display options dialog

Using the width parameter

When you use the "AUTO" value, note that:

  • The width is determined by the length of the longest unbroken value in that column. For example, this could be the length of the longest word in a paragraph or the width of the widest image.
  • If you use "ICON" & "AUTO" widths together, the column using "ICON" will always be the same width and the column using "AUTO" will fill up the remaining space.
  • You should avoid using "AUTO" and weighted column widths (such as "1X", "2X", or "3X") together.

If you use a fixed width (such as "NARROW" or "MEDIUM") for a column that doesn't take up the width of the page, the width will auto distribute depending on the content inside the column.

For complete guidance on when and how to use column widths, see Column Widths.

Using the backgroundColor parameter

To conditionally format the background color, use a logical function like a!match() to define the conditions and the color to display when the condition is met. See the grid with heatmap pattern for an example of a grid with conditionally formatted background colors. Note that header cells do not display a background color.

Note:  Background colors are not included when you export a grid to Excel. Instead, you can save the page as a PDF if you want to include the grid background colors and share it with users who don't have access to your app.

Using the accessibilityText parameter

When you've configured a background color, you should also set equivalent accessibilityText values for screen readers to announce. This way, your grid will be accessible to a wider range of users.

For example, say your grid shows product information and one column shows the average customer rating. You could set the column's backgroundColor to be red, yellow, or green based on the value of that field. To indicate the meaning of these values to screen readers, add the accessibilityText parameter with text to read when the same conditions are met.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
a!gridColumn(
  label: "Average customer rating",
  backgroundColor: a!match(
    value: fv!row,
    whenTrue: fv!row <= 4,
    then: "NEGATIVE",
    whenTrue: fv!row <= 7,
    then: "WARN",
    whenTrue: fv!row >= 8,
    then: "SUCCESS"
    default: "NONE"),
  accessibilityText: a!match(
    value: fv!row,
    whenTrue: fv!row <= 4,
    then: "Poor",
    whenTrue: fv!row <= 7,
    then: "OK",
    whenTrue: fv!row >= 8,
    then: "Good",
    default: "No ratings")

The screen reader will announce the value of label, so you don't need to include the word rating in the accessibilityText values.

Using the exportWhen parameter

The exportWhen parameter allows you to choose which columns are exported from a records-powered grid.

You can use this parameter to omit certain columns from export, like those containing formatting or styling unsupported by Microsoft Excel, and add additional columns that are only visible upon export.

For example, the expression below includes a column for "Status," which uses rich text icons to indicate whether a customer is active or inactive. Since icons cannot be exported to Excel, the column is hidden from export and an additional "Status" column is configured to export instead.

Similarly, the column containing record actions is also hidden from export, since users can't access the actions in Excel.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
  a!gridField(
    label: "Read-only Grid",
    labelPosition: "ABOVE",
    data: recordType!Customer,
    columns: {
      a!gridColumn(
        label: "Name",
        sortField: recordType!Customer.fields.displayName,
        value: a!linkField(
          links: {
            a!recordLink(
              label: fv!row[recordType!Customer.fields.displayName],
              recordType: {
                recordType!Customer
              },
              identifier: fv!row[recordType!Customer.fields.id]
            )
          }
        )
      ),
      a!gridColumn(
        label: "District",
        sortField: recordType!Customer.relationships.district.fields.name,
        value: fv!row[Customer.relationships.district.fields.name]
        align: "START"
      ),
      a!gridColumn(
        label: "Status",
        sortField: recordType!Customer.fields.isActive,
        value: if(
          fv!row[recordType!Customer.fields.isActive],
          a!richTextDisplayField(
            label: "active icon",
            labelPosition: "COLLAPSED",
            value: a!richTextIcon(
              icon: "check-circle",
              color: "POSITIVE"
            )
          ),
          a!richTextDisplayField(
            label: "inactive icon",
            labelPosition: "COLLAPSED",
            value: a!richTextIcon(
              icon: "times-circle",
              color: "SECONDARY"
            )
          )
        ),
    /* Hide this column from export since */
    /* rich text icons cannot be exported to Excel */
        exportWhen: false
      ),
      a!gridColumn(
        label: "Status",
        value: if(
          fv!row[recordType!Customer.fields.isActive],
          "Active",
          "Inactive"
        ),
    /* Hide this column from the app, but */
    /* export this column to show customer status */
        showWhen: false,
        exportWhen: true
      ),
      a!gridColumn(
        label: "YTD Payment",
        sortField: recordType!Customer.fields.ytdPayment,
        value: if(
          isnull(
            fv!row[recordType!Customer.fields.ytdPayment]
          ),
          "-",
          fixed(
            fv!row[recordType!Customer.fields.ytdPayment],
            2
          )
        ),
        align: "END"
      ),
      a!gridColumn(
        label: "# Payments",
        sortField: recordType!Customer.fields.paymentCount,
        value: fv!row[recordType!Customer.fields.paymentCount],
        align: "END"
      ),
      a!gridColumn(
        label: "# Deliveries",
        sortField: recordType!Customer.fields.deliveryCount,
        value: fv!row[recordType!Customer.fields.deliveryCount],
        align: "END"
      ),
      a!gridColumn(
        label: "Customer Since",
        sortField: recordType!Customer.fields.customerSince,
        value: if(
          isnull(
            fv!row[recordType!Customer.fields.customerSince]
          ),
          "-",
          datetext(
            fv!row[recordType!Customer.fields.customerSince],
            "default"
          )
        ),
        align: "END"
      ),
      a!gridColumn(
        label: "",
        value: a!recordActionField(
           actions:{
             a!recordActionItem(
               action: recordType!Customer.actions.updateCustomer,                         
               identifier: fv!identifier 
             ),
             a!recordActionItem(
               action: recordType!Customer.actions.deleteReCustomer,                         
               identifier: fv!identifier 
             )
           },
           style: "MENU_ICON"
         ),
      /* Hide this column from export since */
      /* record actions aren't needed upon export */
         exportWhen: false
      )
    },
    showExportButton: true,
    validations: {},
    refreshAfter: "RECORD_ACTION",
    showSearchBox: true,
    showRefreshButton: true,
  )
}

Examples

You can find example configurations of a read-only grid and its columns at Configuring the Read-Only Grid and Grid Tutorial.

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.

Old versions

There are older versions of this interface component. You can identify older versions by looking at the name to see if there is a version suffix. If you are using an old version, be sure to refer to the corresponding documentation from the list below.

Old Versions Reason for Update
a!gridTextColumn

Now supports multiple interface components.

To learn more about how Appian handles this kind of versioning, see the Function and Component Versions page.

The following recipes include usage of the Read-Only Grid Column Component.

Feedback