1. Use Cases
Use the Attachment component to upload file content such as certificates, materials, data, and contracts. Each attachment in YiDA is currently limited to 100 MB.For component attributes, usage, and examples, see Interface.
2. Basic Features
2.1 Upload Type
Feature: Set how attachments are uploaded. Path: Attribute >> Upload detail settings >> Upload type Two upload types are available: click and drag-and-drop. Click (when set to click, click Upload File to upload attachments directly) Drag-and-drop (when set to drag-and-drop, drag files into the dashed box to upload):2.2 Button Content
Feature: Set the text of the upload button. Path: Attribute >> Upload detail settings >> Button content (this option appears only when the upload type is set to click) The effect is as follows: The button content defaults to Upload File. You can customize the button text to fit your needs. The effect is as follows:2.3 Button Type
Three button types are available: primary, second (secondary), and normal. primary: the button has a blue background with white text. The effect is as follows: second (secondary): the button has a blue border and blue text. The effect is as follows: normal: the button has a gray border and gray text. The effect is as follows:2.4 Multiselect and Maximum Number of Files
2.4.1 Multiselect
Feature: When Multiselect is on, users can upload multiple attachments at once. Path: Attribute >> Upload detail settings >> Multiselect Note: With Multiselect on, users can select multiple files when uploading. The number of files they can select depends on the value set in “Maximum number of files.”2.4.2 Maximum Number of Files
Feature: Set the maximum number of attachments that can be uploaded. Path: Attribute >> Upload detail settings >> Maximum number of files When the maximum number of files is set to 4, the effect is as follows:2.5 Upload File Type
Feature: Set the file formats allowed for upload.File extensions support only digits and English letters.
2.6 Online Attachment Preview
Previewing before submission lets you verify that the uploaded attachments are correct. Previewing after submission reduces the need to download attachments and saves local storage. Online attachment preview is now supported on both PC and mobile, before and after data submission. Preview supports three types of Office documents—Excel, Word, and PPT—as well as PDF. Supported extensions: Excel: et, xls, xlt, xlsx, xlsm, xltx, xltm, csv Word: doc, docx, txt, dot, wps, wpt, dotx, docm, dotm PPT: ppt, pptx, pptm, pptm, ppsm, pps, potx, potm, dpt, dps Online preview on PC Online preview on mobile2.7 Upload Attachments in Comments
When commenting on submitted form data, you can upload attachments on both PC and mobile. Upload attachments in comments on PC Upload attachments in comments on mobile3. Online Attachment Editing
3.1 Prerequisites
Note: This feature is exclusive to the Professional edition and above.- Attachment editing currently supports three types of Office documents: Word, PPT, and Excel. Supported extensions:
3.2 How to Enable
To use online attachment editing, first turn on the “Online editing” switch on the Attachment component. Turning on this switch only means the form supports online editing. To edit uploaded attachments after data submission, you also need to configure permissions. Note: Permission configuration differs between forms and workflow forms. Refer to the following paths: Path: Open the target form >> Settings >> Page permissions >> Add permission group >> Select the editable permission in the Attachment column Path: Open the target workflow form >> Settings >> Workflow design >> Set up the approval node >> Configure the action permissions of the approver at the current approval node >> Select “Editable” in the Attachment column (approvers with this permission can edit attachments online during approval) After configuration, open the form details to edit attachments online. The effect is as follows: Click the “Edit” button to open a new editing page.3.3 How Online Editing Works
3.3.1 Auto-Save
The editing page saves automatically after each edit. You can also press “Ctrl+S” to save manually. Frequent saving is not recommended. Each manual save creates a new version, and the system limits saved versions to 10.3.3.2 Collaboration Records
Click “Collaboration records” in the upper-right corner to view the edit history of every user who has worked on the document. Note: The “Version history” feature on this page is not yet available. The effect is as follows:4. Advanced Validation
Example scenario: Require users to upload exactly 2 attachments—no more, no fewer. Path: Turn on Multiselect >> Set the maximum number of files to 2 >> Click Validation >> Custom function. Copy the following code into the custom function page. The effect is as follows: Copy and reuse the following code (adjust the number as needed, but keep it in sync with the maximum number of files):5. FAQ
5.1 How do I set a minimum number of attachments?
5.1 How do I set a minimum number of attachments?
To set a minimum number of attachments, configure a custom validation function on the Attachment component.Path: Click the Attachment component >> Attribute panel >> Custom validation functionCopy and reuse the following code:
5.2 How do I export attachment files?
5.2 How do I export attachment files?
Exporting attachments and images is supported. Download the files from the data management page.
5.3 Why can't uploaded images be rotated?
5.3 Why can't uploaded images be rotated?
Images uploaded through the Attachment component cannot be rotated. If you need rotation, use the Image Upload component to submit image data.
5.4 How do I get the online preview URL of an attachment?
5.4 How do I get the online preview URL of an attachment?
Create an OnChange action on the Attachment component. The preview URL does not include a domain, so when assigning it to a Single-line text component, prepend “https://www.yidaapps.com” as shown below:Code example:
5.5 Attachment Preview Error: Server Error, Try Again!
If the error “Server error, try again!” appears when previewing an attachment on the Source records page, check whether the DingTalk UserID of the user performing the preview contains an underscore ”_”. UserID supports only uppercase and lowercase letters, digits 0-9, and hyphens (-). Path to set UserID: Admin signs in to the DingTalk Admin Console >> [Contacts] in the left panel >> [Internal Contacts Management] >> [Add User] >> Set [Employee UserID]. Tips:- UserID is the unique identifier of an employee in the organization. Once generated, it cannot be changed.
- After leaving and rejoining the organization, previous records—such as attendance, reports, approvals, and YiDA form data—can no longer be viewed. Proceed with caution.
5.6 Conditions for Attachment Preview
- Attachment preview has file size limits: 20 MB for the Free plan and Basic edition, and 60 MB or more for the Professional and Dedicated editions. Larger files must be downloaded to your device before previewing.