Form Field Sets

A Form Field Set is a custom form to be used for bundle and inbox registrations.

Each Form Field Set contains one or more Form Fields. A form and all of its form fields are submitted in a single create request. The order of form fields in the array is the order they will be displayed.

Once created, a form field set can then be associated with one or more bundle(s) and/or inbox(s). Once associated, you will be required to submit well-formatted form-data when creating a bundle-registration or inbox registration.

Custom answers saved on a registration are saved as Custom Metadata on each file uploaded through that registration, with field labels as keys. This applies to existing registrations as well as new ones. Unanswered optional fields and values exceeding 1024 characters are omitted; the first 32 remaining answers in saved form-answer order are captured. Dates use YYYY-MM-DD. Existing answers with unavailable field definitions or unparseable dates are omitted. Built-in name, email, and company fields are excluded. Form answers take precedence over explicit upload metadata with matching keys, including keeping omitted answer labels absent.

Enable require_complete_metadata_capture to reject answers exceeding these value or count limits instead of omitting them. Uploaded files use the labels and answers accepted at registration even if the form is edited later.

Editing a field definition creates a replacement field with a new ID and preserves the original definition for existing registration answers. Unchanged fields and fields moved within the layout retain their IDs. Use the returned form_layout when submitting new answers or editing the form again.

Authenticated form field set responses include historical definitions in form_fields so existing answers can still be interpreted. Only IDs in form_layout are current fields. Forms embedded in Share Link and Inbox responses contain current definitions only.

List Form Field Sets

SDK Method

form_field_set.List()

Return Values

Returns a *form_field_set.Iter and an error. Range over All() to receive files_sdk.FormFieldSet values and errors. Check each loop error before using its resource. Next() and Err() remain supported.

Authorization Requirement

Available to all authenticated keys or sessions.

FormFieldSetListParams Fields

FieldDescription
UserId
int64
User ID. Provide a value of 0 to operate the current session's user.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    form_field_set "github.com/Files-com/files-sdk-go/v3/formfieldset"
)

formFieldSetIterator, err := form_field_set.List(files_sdk.FormFieldSetListParams{UserId: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}

for formFieldSet, err := range formFieldSetIterator.All() {
    if err != nil {
        var respErr files_sdk.ResponseError
        if errors.As(err, &respErr) {
            fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
        } else {
            fmt.Printf("Request failed: %v\n", err)
        }
        return
    }
    fmt.Println(formFieldSet)
}

Show Form Field Set

SDK Method

form_field_set.Find()

Return Values

Returns a files_sdk.FormFieldSet value and an error.

Authorization Requirement

Available to all authenticated keys or sessions.

FormFieldSetFindParams Fields

FieldDescription
Id
int64
Required
Form Field Set ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    form_field_set "github.com/Files-com/files-sdk-go/v3/formfieldset"
)

formFieldSet, err := form_field_set.Find(files_sdk.FormFieldSetFindParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(formFieldSet)

Create Form Field Set

SDK Method

form_field_set.Create()

Return Values

Returns a files_sdk.FormFieldSet value and an error.

Authorization Requirement

Available to all authenticated keys or sessions.

FormFieldSetCreateParams Fields

FieldDefaultDescription
UserId
int64
User ID. Provide a value of 0 to operate the current session's user.
Title
string
Title to be displayed
RequireCompleteMetadataCapture
boolean
falseReject answers over 1024 characters or more than 32 answered custom fields to ensure complete file metadata capture
WorkspaceId
int64
Workspace ID
SkipEmail
boolean
Skip validating form email
SkipName
boolean
Skip validating form name
SkipCompany
boolean
Skip validating company
FormFields
array(object)

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    form_field_set "github.com/Files-com/files-sdk-go/v3/formfieldset"
)

formFieldSet, err := form_field_set.Create(files_sdk.FormFieldSetCreateParams{UserId: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(formFieldSet)

Update Form Field Set

SDK Method

form_field_set.Update()

Return Values

Returns a files_sdk.FormFieldSet value and an error.

Authorization Requirement

Available to all authenticated keys or sessions.

FormFieldSetUpdateParams Fields

FieldDescription
Id
int64
Required
Form Field Set ID.
Title
string
Title to be displayed
RequireCompleteMetadataCapture
boolean
Reject answers over 1024 characters or more than 32 answered custom fields to ensure complete file metadata capture
WorkspaceId
int64
Workspace ID
SkipEmail
boolean
Skip validating form email
SkipName
boolean
Skip validating form name
SkipCompany
boolean
Skip validating company
FormFields
array(object)

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    form_field_set "github.com/Files-com/files-sdk-go/v3/formfieldset"
)

formFieldSet, err := form_field_set.Update(files_sdk.FormFieldSetUpdateParams{
  Id: 1,
  Title: "Sample Form Title",
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(formFieldSet)

Delete Form Field Set

SDK Method

form_field_set.Delete()

Return Values

Returns an error, or nil on success.

Authorization Requirement

Available to all authenticated keys or sessions.

FormFieldSetDeleteParams Fields

FieldDescription
Id
int64
Required
Form Field Set ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    form_field_set "github.com/Files-com/files-sdk-go/v3/formfieldset"
)

err := form_field_set.Delete(files_sdk.FormFieldSetDeleteParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}

The FormFieldSet Object

Some of the methods above return a FormFieldSet object. The attributes of this object are listed below.

AttributeDescription
Id
int64
Form field set id
Title
string
Title to be displayed
RequireCompleteMetadataCapture
boolean
Reject answers over 1024 characters or more than 32 answered custom fields to ensure complete file metadata capture
FormLayout
array(int64)
Layout of the form
FormFields
array(object)
Associated form field definitions; authenticated form field set responses include historical definitions, while form_layout identifies current fields
SkipName
boolean
Any associated InboxRegistrations or BundleRegistrations can be saved without providing name
SkipEmail
boolean
Any associated InboxRegistrations or BundleRegistrations can be saved without providing email
SkipCompany
boolean
Any associated InboxRegistrations or BundleRegistrations can be saved without providing company
InUse
boolean
Form Field Set is in use by an active Inbox / Bundle / Inbox Registration / Bundle Registration