File Upload
The File Upload component allows users to upload a file through the form to the temporary upload folder, where it is typically stored for 24 hours.
The stored value of the variable is the ID of the temporary file as a String. You can use the FileApi to retrieve information about the uploaded file or follow the Add an attachment with a workflow tutorial to add the file as an attachment to the resource the workflow . The following script demonstrates how to add the file as an attachment, assuming the variable that stores the file ID is named file
:
import com.collibra.dgc.core.api.dto.instance.attachment.AddAttachmentRequest
import com.collibra.dgc.core.api.model.file.FileInfo
UUID fileUUID = string2Uuid(file)
FileInfo fileInfo = fileApi.getFileInfo(fileUUID)
String fileName = fileInfo.getName()
InputStream fileStream = fileApi.getFileAsStream(fileUUID)
AddAttachmentRequest attachmentRequest = AddAttachmentRequest.builder()
.baseResourceId(item.getId())
.baseResourceType(item.getType())
.fileStream(fileStream)
.fileName(fileName)
.build()
attachmentApi.addAttachment(attachmentRequest)
There is no need to explicitly import com.collibra.dgc.core.api.component.instance.AttachmentApi
and com.collibra.dgc.core.api.component.file.FileApi
. In the context of workflow script tasks, the <Resource>Api interfaces (such as AssetApi, CommunityTypeApi, FileApi, and so on) are already instantiated and accessible via <resource>Api variables (such as assetApi, communityTypeApi, fileApi, and so on).
General properties
Property | Description |
---|---|
ID | The identifier of the component, primarily used for client-side interactions and identification in the HTML structure of the form. When you add a component, an ID is automatically generated to ensure it is unique in the form. |
Label | Text that appears above the form component in Collibra, briefly describing its purpose. This is the main title or question for the field. |
Label tooltip |
Additional help or information about the field. If defined, a question mark icon appears after the label, showing the tooltip when users hover their pointer over the icon. The tooltip supports plain text only. |
Documentation | A text field for internal design notes or future reference about this specific component. This information is not visible in Collibra. |
Value |
The name of the variable that stores the data entered into this field in Collibra. Use a variable name enclosed in double curly braces, for example You can also specify where the variable is saved:
|
Default value | The pre-filled value for the component when the form first appears. A filed shows the default value if the Value property does note set a value explicitly. |
Validation properties
Attribute | Description |
---|---|
Required | Whether the component must have a value for the form to be submitted. |
Custom validations | A list of additional validations for the component. Each custom validation consists of two parts:
For example, you can create a validation with the expression |
Rendering properties
Property | Description |
---|---|
Ignored | Whether the component is be hidden in the form and any value it might hold is not included in the submission data. |
Visible | Whether the component is shown or hidden on the form. You can controlled this unconditionally or through an expression. For example, you can set an expression that hides or shows the component based on a user selection in another component. This property is enabled by default. |
Enabled | Whether the component is interactive or read-only on the form. When disabled, users cannot change the component value. This property is enabled by default. |
Description | Additional information shown in Collibra below the form field, providing detailed instructions, examples, or essential guidance. |