Free cookie consent management tool by TermsFeed
[go: up one dir, main page]

Form Layout

SAIL Design System guidance available for Form Layout

When you need to collect data in a structured, intuitive way, use the form layout. Learn how to use the form layout to simplify data collection and create forms that work as seamlessly as they look.

Function

a!formLayout( titleBar, isTitleBarFixed, showTitleBarDivider, backgroundColor, showWhen, contents, contentsWidth, focusOnFirstInput, buttons, isButtonFooterFixed, showButtonDivider, validations, validationGroup )

Displays any arrangement of layouts and components beneath a header and above buttons. Use this as the top-level layout for start and task forms.

form_layout_example

See also: Wizard Layout

Parameters

Name Keyword Types Description

Title Bar

titleBar

Any Type

Prominent text that includes a title and optional secondary text. Can be styled using templates or billboard and card layouts. Configure using text, a!headerTemplateSimple(), a!headerTemplateFull() or a!headerTemplateImage(), a single a!billboardLayout() or a!cardLayout(), or an array of both layouts.

Fix title bar when scrolling

isTitleBarFixed

Boolean

Determines whether the title bar remains at the top of the form when scrolling. In Appian Mobile, the title bar is never fixed. Default: If the parameter isn't specified, the title bar is not fixed. If the parameter isn’t specified and the form is in a dialog, the title bar is fixed.

Show title bar divider

showTitleBarDivider

Boolean

Determines whether to display a divider line to separate the title bar from the rest of the form. Default: If the parameter isn't specified, the divider is hidden. If the parameter isn’t specified and the form is in a dialog, the divider displays.

Background Color

backgroundColor

Text

Color to show behind the contents of the form. Valid values: Valid values: Any valid hex color or hex color including transparency, or "WHITE" (default), "TRANSPARENT", "CHARCOAL_SCHEME", "NAVY_SCHEME", "PLUM_SCHEME". To add transparency to the hex color, add two additional digits between 00 (more transparent) and FF (less transparent).

Show When

showWhen

Boolean

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

Contents

contents

Any Type Array

Components and layouts to display in the form body.

Contents Width

contentsWidth

Text

Determines the width of the form contents. Valid values: “EXTRA_NARROW”, "NARROW", "MEDIUM", "WIDE", "FULL". Default: If the parameter isn't specified, the width is "NARROW". If the parameter isn’t specified and the form is in a dialog, the width is "FULL". If the form contents is a!paneLayout(), the width is always "FULL".

Automatically focus on first input

focusOnFirstInput

Boolean

Determines whether to automatically focus on the first input when the form loads. Default: true.

Buttons

buttons

Button Layout

Buttons to display at the bottom of the form, arranged using a!buttonLayout().

Fix buttons to bottom of form

isButtonFooterFixed

Boolean

Determines whether the buttons are fixed to the bottom of the form. In Appian Mobile, the buttons are never fixed. Default: If the parameter isn't specified, the buttons are not fixed. If the parameter isn’t specified and the form is in a dialog, the buttons are fixed.

Show button divider

showButtonDivider

Boolean

Determines whether to display a divider line above the buttons. Default: If the parameter isn't specified, the divider is hidden. If the parameter isn’t specified and the form is in a dialog, the divider displays.

Validations

validations

Text or Validation Message

Validation errors displayed above the form buttons. Configured using a text array or an array with a mix of text and Validation Message using a!validationMessage(message, validateAfter).

Validation Group

validationGroup

Text or Validation Message Array

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:

Usage considerations

Title bar options

Related style guidelines: Title bar guidelines

For the title bar, you can choose either a simple header, full header, image header or sidebar template. See the SAIL Design System for more information about when to choose each template.

header-template-compare.png

You can also just enter text as a string. For example, titleBar: "Add Product".

Additionally, you can configure a custom header using billboard and card layouts.

Contents width in record action dialogs

Related style guidelines: Use "Full" width when displaying forms in dialogs, Use one narrow column for the form content, Don't add additional columns to center form content

If you are planning to display this component in a record action dialog, keep in mind that the dialog size is set in the record type and that the step contents width is set in the wizard layout. Open the record action to make sure the contents width works with the selected dialog size.

We recommend setting the contentsWidth parameter to "FULL" when displaying this component in a dialog.

Dynamic defaults

Some parameters have dynamic defaults that automatically adapt based on if they are displayed in a dialog or not.

The following table details the behavior of these parameters when they are not specified in the expression.

Specifying any of these parameters in the expression will override this behavior.

Parameter In a dialog In a page
contentsWidth Full Narrow
isTitleBarFixed
isButtonFooterFixed
Fixed Not fixed
showTitleBarDivider
showButtonDivider
Visible Hidden

Using the focusOnFirstInput parameter

If focusOnFirstInput is true, the focus will be applied to the first component that is one of the following:

Responsiveness of sidebar template

Related style guidelines: Sidebar template guidelines

The sidebar is fully responsive and its appearance will change based on the screen width.

On narrow screens, the sidebar automatically displays as a header at the top of the interface. This includes when it displays in dialogs that use Medium width or narrower.

When the sidebar displays as a header, the image is hidden, but any components in the additionalContents parameter will still be displayed below the secondary text.

Sidebar on a wider screen:

a sidebar layout on a wider screen

Sidebar on a narrower screen:

a sidebar layout on a narrower screen

Using a pane layout in a form layout

Related style guidelines: Turn off pane dividers in forms with header and button footer dividers

You can place a single pane layout within the contents parameter of a form layout to create forms with multiple, independently scrolling columns of content.

When a pane layout is used in a form layout:

  • The form's header and button footer will span across the top and bottom of all panes.
  • The contentsWidth parameter of the form layout will always use "FULL". The panes will always occupy the entire width of the form's content area.

pane layout in form layout example

Heading levels for headingTag parameters

In form layouts, the title bar title uses "H1" for the heading level. When you use the headingTag parameter in components such as box and section layouts, use "H2" for the highest-level headings.

Back buttons in activity chained tasks

For a back button to appear in activity-chained tasks a button layout must be present in the form.

Using the validations parameter

Use form validation messages for problems that are not specific to a single component.

Examples

Basic form

Use the interactive editor below to test out the example code.

Form with background color

To experiment with examples, copy and paste the expression into an interface object.

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
a!localVariables(
  local!data:a!map( firstName:null, lastName:null, email:null, country:null, orgName:null, title:null ),
  a!formLayout(
    titleBar: a!headerTemplateSimple(
      title: "REGISTER NOW",
      secondaryText:"Enter your details below to register for the conference",
    ),
    backgroundColor: "#f8f6f0",
    contentsWidth: "MEDIUM",
    contents: {
      a!sectionLayout(
        label: "YOUR DETAILS",
        labelSize: "SMALL",
        labelColor: "STANDARD",
        contents: {
          a!cardLayout(
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "First name",
                        value: local!data.firstName,
                        saveInto: local!data.firstName
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Last name",
                        value: local!data.lastName,
                        saveInto: local!data.lastName
                      )
                    }
                  )
                }
              ),
              a!textField(
                label: "Email address",
                labelPosition: "ABOVE",
                value: local!data.email,
                saveInto: local!data.email,
                marginAbove: "STANDARD"
              ),
              a!dropdownField(
                label: "Country",
                labelPosition: "ABOVE",
                placeholder: "Select your country of residence",
                choiceLabels: {"United States", "United Kingdom", "Canada"},
                choiceValues: {1, 2, 3},
                value: local!data.country,
                saveInto: local!data.country,
                marginAbove: "STANDARD"
              ),
              a!textField(
                label: "Organization name",
                labelPosition: "ABOVE",
                value: local!data.orgName,
                saveInto: local!data.orgName,
                marginAbove: "STANDARD"
              ),
              a!textField(
                label: "Job title",
                labelPosition: "ABOVE",
                value: local!data.title,
                saveInto: local!data.title,
                marginAbove: "STANDARD"
              )
            },
            style: "#f2ede1",
            shape: "SEMI_ROUNDED",
            padding: "STANDARD",
            marginBelow: "STANDARD",
            borderColor: "#d4cebe"
          )
        },
        marginAbove: "STANDARD"
      )
    },
    buttons: a!buttonLayout(
      primaryButtons: {
        a!buttonWidget(
          label: "Register",
          icon: "arrow-right",
          submit: true,
          validate: true,
          style: "SOLID",
          color: "#DEB03D"
        )
      },
      secondaryButtons: {
        a!buttonWidget(
          label: "Cancel",
          submit: true,
          validate: false,
          saveInto: {},
          style: "OUTLINE",
          color: "#000000",
          value: true
        )
      }
    ),
    showButtonDivider: false
  )
)

Displays the following:

screenshot of a form with background color

Empty form with panes

This example shows an empty pane layout within a form layout.

To experiment with this example, copy and paste the expression into an interface object, or select the Form with Panes template from an empty interface object.

screenshot of how to select form with panes template in an interface object

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
a!formLayout(
  titleBar: a!headerTemplateFull(
    title: "Form",
    secondaryText: "Enter your details",
    secondaryTextColor: "SECONDARY",
    backgroundColor: "ACCENT"
  ),
  showTitleBarDivider: false,
  contents: {
 a!paneLayout(
      panes: {
        a!pane(contents: {}, width: "NARROW_PLUS"),
        a!pane(contents: {}, width: "AUTO")
      }
    )
  },
  buttons: a!buttonLayout(
    primaryButtons: {
      a!buttonWidget(
        label: "Submit",
        submit: true,
        style: "SOLID",
        loadingIndicator: true
      )
    },
    secondaryButtons: {
      a!buttonWidget(
        label: "Cancel",
        value: true,
        saveInto: ri!cancel,
        submit: true,
        style: "OUTLINE",
        validate: false
      )
    }
  ),
  showButtonDivider: true
)

Pane layout in form layout

This example shows a document review form created with a pane layout in a form layout. It displays the following interface.

a pane layout in form layout with a document viewer in one pane and form fields in another pane

To experiment with examples, copy and paste the expression into an interface object.

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
a!formLayout(
  titleBar: a!headerTemplateSimple(
    title: "Review Form Data",
    secondaryText: "Review the information extracted from the submitted document. Compare the details below with the form on the left. Correct any fields that are inaccurate before submitting.",
    secondaryTextColor: "STANDARD"
  ),
  showTitleBarDivider: true,
  contents: {
    a!paneLayout(
      panes: {
        a!pane(
          contents: {
            a!documentViewerField(
              labelPosition: "COLLAPSED",
              /* Replace this with a document constant in your environment */
              /* document: cons!DOC_EXAMPLE, */
              height: "TALL"
            )
          },
          width: "AUTO",
          padding: "NONE"
        ),
        a!pane(
          contents: {
            a!textField(
              label: "Name"
            ),
            a!textField(
              label: "Street Address"
            ),
            a!textField(
              label: "City"
            ),
            a!dropdownField(
              data: null,
              label: "State",
              placeholder: "Select a state"
            ),
            a!integerField(
              label: "Zip Code"
            ),
            a!textField(
              label: "Phone Number"
            ),
            a!textField(
              label: "Email"
            ),
            a!paragraphField(
              label: "Supporting Information",
              height: "TALL"
            ),
            a!dateField(
              label: "Start Date"
            ),
            a!dateField(
              label: "End Date"
            )
          },
          width: "NARROW_PLUS",
          backgroundColor: "GRAY"
        )
      },
      showPaneDividers: false
    )
  },
  buttons: a!buttonLayout(
    primaryButtons: {
      a!buttonWidget(
        label: "Submit",
        style: "SOLID"
      )
    },
    secondaryButtons: {
      a!buttonWidget(
        label: "Cancel"
      )
    }
  ),
  showButtonDivider: true
)

Feature compatibility

The table below lists this component's compatibility with various features in Appian.
Feature Compatibility Note
Portals Compatible
Offline Mobile 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.

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!formLayout_17r1

Replaced firstColumnContents and secondColumnContents with contents. Now supports greater than two-column layout.

a!formLayout_25r1

Added support for title bar templates and added dynamic defaults for contentsWidth, showTitleBarDivider, and showButtonDivider parameters. These parameters now automatically adapt based on if the form is displayed in a dialog or not.

For more on what's changed, see New version details.

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

The following patterns include usage of the Form Layout.

Feedback