AttachmentsFormElement

A form element that holds one or more attachments on a feature. The AttachmentsFormElement specifies how one or more attachments can participate in the form. When present in the form, the user has the ability to edit the list of attachments specific to the form element.

Since

200.5.0

Properties

Link copied to clipboard

True if the user can rename attachments added through this element, false otherwise. If false, client applications should prevent user-driven attachment renaming for this element. If not provided in the form definition, the default value is true.

Link copied to clipboard

Defines how existing attachments are associated with this element. This determines whether existing attachments are matched by any keyword, by an exact keyword match, or by an exact keyword match including attachments that have no keyword. If not provided in the form definition, the default value is AttachmentKeywordAssociation.Exact.

Link copied to clipboard

Returns all the current attachments. This is empty if attachments haven't yet been fetched.

Link copied to clipboard

True if attachment file names should be displayed, false otherwise. If not provided in the form definition, the default value is false.

Link copied to clipboard

The input types that can be used to add attachments.

Link copied to clipboard
val isEditable: StateFlow<Boolean>

True if the element is editable, False otherwise. This property can be modified by the editable expression, which can be set during Feature Form authoring.

Link copied to clipboard

A string to identify the attachment(s). When a file is attached using the form, this property sets the value of the keywords field for the attachment. When a form displays existing attachments, this property is used to query attachments with an exact match on the keywords field.

Link copied to clipboard

The maximum number of attachments allowed for this element. This is null if there is no maximum configured.

Link copied to clipboard

The minimum number of attachments required for this element.

Link copied to clipboard

True if uploaded attachments preserve their original file name, false otherwise. If false, the attachment should be added without a name to allow the system to generate one automatically. If not provided in the form definition, the default value is true.

Link copied to clipboard

An array of validation errors for this element. The errors returned may be any of the following error types:

Inherited properties

Link copied to clipboard

A detailed description of the element.

Link copied to clipboard
val isVisible: StateFlow<Boolean>

The form element's visibility. This property can be modified by the visibility expression.

Link copied to clipboard

A descriptive label that appears with the element. If not supplied, a FieldFormElement is labeled with the alias property of the associated field.

Functions

Link copied to clipboard
suspend fun addAttachment(contentType: String, filePath: String): Result<FormAttachment>
suspend fun addAttachment(name: String, contentType: String, filePath: String): Result<FormAttachment>

Adds a new attachment to this AttachmentsFormElement from the specified file.

suspend fun addAttachment(contentType: String, data: ByteArray, name: String? = null): Result<FormAttachment>
fun addAttachment(name: String, contentType: String, data: ByteArray): FormAttachment

Adds a new attachment to this AttachmentsFormElement.

Link copied to clipboard
fun addAttachmentOrNull(name: String, contentType: String, data: ByteArray): FormAttachment?

Adds a new attachment to this AttachmentsFormElement.

Link copied to clipboard

Deletes an attachment from the Feature.

Link copied to clipboard
suspend fun fetchAttachments(): Result<Unit>

Fetches the attachments from the Feature and populates AttachmentsFormElement.attachments. Attachments are not re-fetched if they have already been fetched.

Inherited functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun toJson(): String

Convert an object to JSON string.