UpdateFormCommand

Updates an existing form.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { AmplifyUIBuilderClient, UpdateFormCommand } from "@aws-sdk/client-amplifyuibuilder"; // ES Modules import
// const { AmplifyUIBuilderClient, UpdateFormCommand } = require("@aws-sdk/client-amplifyuibuilder"); // CommonJS import
const client = new AmplifyUIBuilderClient(config);
const input = { // UpdateFormRequest
  appId: "STRING_VALUE", // required
  environmentName: "STRING_VALUE", // required
  id: "STRING_VALUE", // required
  clientToken: "STRING_VALUE",
  updatedForm: { // UpdateFormData
    name: "STRING_VALUE",
    dataType: { // FormDataTypeConfig
      dataSourceType: "STRING_VALUE", // required
      dataTypeName: "STRING_VALUE", // required
    },
    formActionType: "create" || "update",
    fields: { // FieldsMap
      "<keys>": { // FieldConfig
        label: "STRING_VALUE",
        position: { // FieldPosition Union: only one key present
          fixed: "first",
          rightOf: "STRING_VALUE",
          below: "STRING_VALUE",
        },
        excluded: true || false,
        inputType: { // FieldInputConfig
          type: "STRING_VALUE", // required
          required: true || false,
          readOnly: true || false,
          placeholder: "STRING_VALUE",
          defaultValue: "STRING_VALUE",
          descriptiveText: "STRING_VALUE",
          defaultChecked: true || false,
          defaultCountryCode: "STRING_VALUE",
          valueMappings: { // ValueMappings
            values: [ // ValueMappingList // required
              { // ValueMapping
                displayValue: { // FormInputValueProperty
                  value: "STRING_VALUE",
                  bindingProperties: { // FormInputValuePropertyBindingProperties
                    property: "STRING_VALUE", // required
                    field: "STRING_VALUE",
                  },
                  concat: [ // FormInputValuePropertyList
                    {
                      value: "STRING_VALUE",
                      bindingProperties: {
                        property: "STRING_VALUE", // required
                        field: "STRING_VALUE",
                      },
                      concat: [
                        "<FormInputValueProperty>",
                      ],
                    },
                  ],
                },
                value: "<FormInputValueProperty>", // required
              },
            ],
            bindingProperties: { // FormInputBindingProperties
              "<keys>": { // FormInputBindingPropertiesValue
                type: "STRING_VALUE",
                bindingProperties: { // FormInputBindingPropertiesValueProperties
                  model: "STRING_VALUE",
                },
              },
            },
          },
          name: "STRING_VALUE",
          minValue: Number("float"),
          maxValue: Number("float"),
          step: Number("float"),
          value: "STRING_VALUE",
          isArray: true || false,
          fileUploaderConfig: { // FileUploaderFieldConfig
            accessLevel: "public" || "protected" || "private", // required
            acceptedFileTypes: [ // StrValues // required
              "STRING_VALUE",
            ],
            showThumbnails: true || false,
            isResumable: true || false,
            maxFileCount: Number("int"),
            maxSize: Number("int"),
          },
        },
        validations: [ // ValidationsList
          { // FieldValidationConfiguration
            type: "STRING_VALUE", // required
            strValues: [
              "STRING_VALUE",
            ],
            numValues: [ // NumValues
              Number("int"),
            ],
            validationMessage: "STRING_VALUE",
          },
        ],
      },
    },
    style: { // FormStyle
      horizontalGap: { // FormStyleConfig Union: only one key present
        tokenReference: "STRING_VALUE",
        value: "STRING_VALUE",
      },
      verticalGap: {//  Union: only one key present
        tokenReference: "STRING_VALUE",
        value: "STRING_VALUE",
      },
      outerPadding: {//  Union: only one key present
        tokenReference: "STRING_VALUE",
        value: "STRING_VALUE",
      },
    },
    sectionalElements: { // SectionalElementMap
      "<keys>": { // SectionalElement
        type: "STRING_VALUE", // required
        position: {//  Union: only one key present
          fixed: "first",
          rightOf: "STRING_VALUE",
          below: "STRING_VALUE",
        },
        text: "STRING_VALUE",
        level: Number("int"),
        orientation: "STRING_VALUE",
        excluded: true || false,
      },
    },
    schemaVersion: "STRING_VALUE",
    cta: { // FormCTA
      position: "top" || "bottom" || "top_and_bottom",
      clear: { // FormButton
        excluded: true || false,
        children: "STRING_VALUE",
        position: {//  Union: only one key present
          fixed: "first",
          rightOf: "STRING_VALUE",
          below: "STRING_VALUE",
        },
      },
      cancel: {
        excluded: true || false,
        children: "STRING_VALUE",
        position: {//  Union: only one key present
          fixed: "first",
          rightOf: "STRING_VALUE",
          below: "STRING_VALUE",
        },
      },
      submit: {
        excluded: true || false,
        children: "STRING_VALUE",
        position: {//  Union: only one key present
          fixed: "first",
          rightOf: "STRING_VALUE",
          below: "STRING_VALUE",
        },
      },
    },
    labelDecorator: "STRING_VALUE",
  },
};
const command = new UpdateFormCommand(input);
const response = await client.send(command);
// { // UpdateFormResponse
//   entity: { // Form
//     appId: "STRING_VALUE", // required
//     environmentName: "STRING_VALUE", // required
//     id: "STRING_VALUE", // required
//     name: "STRING_VALUE", // required
//     formActionType: "create" || "update", // required
//     style: { // FormStyle
//       horizontalGap: { // FormStyleConfig Union: only one key present
//         tokenReference: "STRING_VALUE",
//         value: "STRING_VALUE",
//       },
//       verticalGap: {//  Union: only one key present
//         tokenReference: "STRING_VALUE",
//         value: "STRING_VALUE",
//       },
//       outerPadding: {//  Union: only one key present
//         tokenReference: "STRING_VALUE",
//         value: "STRING_VALUE",
//       },
//     },
//     dataType: { // FormDataTypeConfig
//       dataSourceType: "STRING_VALUE", // required
//       dataTypeName: "STRING_VALUE", // required
//     },
//     fields: { // FieldsMap // required
//       "<keys>": { // FieldConfig
//         label: "STRING_VALUE",
//         position: { // FieldPosition Union: only one key present
//           fixed: "first",
//           rightOf: "STRING_VALUE",
//           below: "STRING_VALUE",
//         },
//         excluded: true || false,
//         inputType: { // FieldInputConfig
//           type: "STRING_VALUE", // required
//           required: true || false,
//           readOnly: true || false,
//           placeholder: "STRING_VALUE",
//           defaultValue: "STRING_VALUE",
//           descriptiveText: "STRING_VALUE",
//           defaultChecked: true || false,
//           defaultCountryCode: "STRING_VALUE",
//           valueMappings: { // ValueMappings
//             values: [ // ValueMappingList // required
//               { // ValueMapping
//                 displayValue: { // FormInputValueProperty
//                   value: "STRING_VALUE",
//                   bindingProperties: { // FormInputValuePropertyBindingProperties
//                     property: "STRING_VALUE", // required
//                     field: "STRING_VALUE",
//                   },
//                   concat: [ // FormInputValuePropertyList
//                     {
//                       value: "STRING_VALUE",
//                       bindingProperties: {
//                         property: "STRING_VALUE", // required
//                         field: "STRING_VALUE",
//                       },
//                       concat: [
//                         "<FormInputValueProperty>",
//                       ],
//                     },
//                   ],
//                 },
//                 value: "<FormInputValueProperty>", // required
//               },
//             ],
//             bindingProperties: { // FormInputBindingProperties
//               "<keys>": { // FormInputBindingPropertiesValue
//                 type: "STRING_VALUE",
//                 bindingProperties: { // FormInputBindingPropertiesValueProperties
//                   model: "STRING_VALUE",
//                 },
//               },
//             },
//           },
//           name: "STRING_VALUE",
//           minValue: Number("float"),
//           maxValue: Number("float"),
//           step: Number("float"),
//           value: "STRING_VALUE",
//           isArray: true || false,
//           fileUploaderConfig: { // FileUploaderFieldConfig
//             accessLevel: "public" || "protected" || "private", // required
//             acceptedFileTypes: [ // StrValues // required
//               "STRING_VALUE",
//             ],
//             showThumbnails: true || false,
//             isResumable: true || false,
//             maxFileCount: Number("int"),
//             maxSize: Number("int"),
//           },
//         },
//         validations: [ // ValidationsList
//           { // FieldValidationConfiguration
//             type: "STRING_VALUE", // required
//             strValues: [
//               "STRING_VALUE",
//             ],
//             numValues: [ // NumValues
//               Number("int"),
//             ],
//             validationMessage: "STRING_VALUE",
//           },
//         ],
//       },
//     },
//     sectionalElements: { // SectionalElementMap // required
//       "<keys>": { // SectionalElement
//         type: "STRING_VALUE", // required
//         position: {//  Union: only one key present
//           fixed: "first",
//           rightOf: "STRING_VALUE",
//           below: "STRING_VALUE",
//         },
//         text: "STRING_VALUE",
//         level: Number("int"),
//         orientation: "STRING_VALUE",
//         excluded: true || false,
//       },
//     },
//     schemaVersion: "STRING_VALUE", // required
//     tags: { // Tags
//       "<keys>": "STRING_VALUE",
//     },
//     cta: { // FormCTA
//       position: "top" || "bottom" || "top_and_bottom",
//       clear: { // FormButton
//         excluded: true || false,
//         children: "STRING_VALUE",
//         position: {//  Union: only one key present
//           fixed: "first",
//           rightOf: "STRING_VALUE",
//           below: "STRING_VALUE",
//         },
//       },
//       cancel: {
//         excluded: true || false,
//         children: "STRING_VALUE",
//         position: {//  Union: only one key present
//           fixed: "first",
//           rightOf: "STRING_VALUE",
//           below: "STRING_VALUE",
//         },
//       },
//       submit: {
//         excluded: true || false,
//         children: "STRING_VALUE",
//         position: {//  Union: only one key present
//           fixed: "first",
//           rightOf: "STRING_VALUE",
//           below: "STRING_VALUE",
//         },
//       },
//     },
//     labelDecorator: "STRING_VALUE",
//   },
// };

UpdateFormCommand Input

See UpdateFormCommandInput for more details

Parameter
Type
Description
appId
Required
string | undefined

The unique ID for the Amplify app.

environmentName
Required
string | undefined

The name of the backend environment that is part of the Amplify app.

id
Required
string | undefined

The unique ID for the form.

updatedForm
Required
UpdateFormData | undefined

The request accepts the following data in JSON format.

clientToken
string | undefined

The unique client token.

UpdateFormCommand Output

See UpdateFormCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
entity
Form | undefined

Describes the configuration of the updated form.

Throws

Name
Fault
Details
InternalServerException
server

An internal error has occurred. Please retry your request.

InvalidParameterException
client

An invalid or out-of-range value was supplied for the input parameter.

ResourceConflictException
client

The resource specified in the request conflicts with an existing resource.

AmplifyUIBuilderServiceException
Base exception class for all service exceptions from AmplifyUIBuilder service.