# Attachments

### 1. Pre-requisites <a href="#id-1.-pre-requisites" id="id-1.-pre-requisites"></a>

* User must have an active Asset Panda Pro account with appropriate permissions.
* Attachment feature flag must be enabled for the organization/user.
* User roles and permissions (Org Admin, Account Admin, Module Admin, Collaborator, Custom Role) must be configured as per organizational policy.
* Supported file types and size limits must be defined in system settings.
* Backend and frontend deployments must be up-to-date with the latest attachment features.

### 2. Feature Overview <a href="#id-2.-feature-overview" id="id-2.-feature-overview"></a>

#### 2.1 Global Attachments <a href="#id-2.1-global-attachments" id="id-2.1-global-attachments"></a>

* Centralized "Attachments" tab available under Tools.
* Displays all files the user has permission to access across the organization.
* Supports search, filter, sort, bulk actions (download, delete), and preview.
* Attachments are visible only if the user has access to at least one linked record.
* Role-based visibility and actions (see section 3.1).

#### 2.2 Record Level Attachments <a href="#id-2.2-record-level-attachments" id="id-2.2-record-level-attachments"></a>

* Each record has an "Attachments" tab showing all files attached to that record.
* Attachments can be tied to specific fields or uploaded directly to the record.
* Supports grid view, search, filter, sort, bulk actions, and preview.
* Field name is displayed for field-tied attachments; "None" if not tied.

#### 2.3 Multiple Attachments Support <a href="#id-2.3-multiple-attachments-support" id="id-2.3-multiple-attachments-support"></a>

* Attachment fields can be configured to allow single or multiple files.
* Multiple attachments can be uploaded, previewed, and managed in both forms and record details.
* Autofill/default values for multiple attachments are not supported in table fields; clarification required for other field types.

#### 2.4 Attachment Field Settings <a href="#id-2.4-attachment-field-settings" id="id-2.4-attachment-field-settings"></a>

* Field settings allow toggling between single and multiple attachments.
* Permissions (View, Create, Delete) are enforced at the field and role level.
* Gallery and Upload buttons are hidden if the user lacks Create permission.

#### 2.5 Attachments in Forms and Tables <a href="#id-2.5-attachments-in-forms-and-tables" id="id-2.5-attachments-in-forms-and-tables"></a>

* Forms (Create/Update) support attachment fields, including multiple attachments.
* Table fields in forms can include attachment columns, but default/autofill values are not supported.
* Attachments in tables/forms must be submitted and saved to be visible in submissions.
* Attachments should display correctly in form submissions and record details.

#### 2.6 Upload Attachments from Gallery <a href="#id-2.6-upload-attachments-from-gallery" id="id-2.6-upload-attachments-from-gallery"></a>

* Users can upload files directly or select from the Global Attachment Gallery.
* Gallery supports pagination, filtering by file type, and search.
* Attachments added via Gallery are linked at the record level unless explicitly tied to a field.

### 3. Step-by-Step Workflow <a href="#id-3.-step-by-step-workflow" id="id-3.-step-by-step-workflow"></a>

#### 3.1 Global Attachments Page <a href="#id-3.1-global-attachments-page" id="id-3.1-global-attachments-page"></a>

1. **Access**: Navigate to Tools → Attachments.
2. **Visibility**: Only attachments linked to accessible records are shown.
   * Org Admin: All files.
   * Account/Module Admin: Files tied to their scope.
   * Collaborator: Files in assigned modules.
   * Custom Role: Files per record access limits.
   * Multi-role: Union of all accessible records.
3. **Search/Filter/Sort**:
   * Search by file name (partial, case-insensitive).
   * Filter by location (Account/Module/Collection), Record ID, File Type, Date Added, File Name.
   * Sort by Record ID, File Type, Date Added, File Name (max 3 fields).
4. **Bulk Actions**:
   * Select attachments via checkboxes.
   * Download (zipped), Delete (if permitted).
   * "Select all" and "Deselect all" options.
5. **Preview**:
   * Click attachment for modal preview.
   * Hide inaccessible record details in preview.

#### 3.2 Record Details Attachments Tab <a href="#id-3.2-record-details-attachments-tab" id="id-3.2-record-details-attachments-tab"></a>

1. **Access**: Open any record → Attachments tab.
2. **View**: Grid of all attachments for the record.
   * Thumbnails/icons by file type.
   * Field name shown if tied; "None" otherwise.
3. **Upload**:
   * Upload new files or select from Gallery.
   * Multiple files supported if field allows.
   * Drag-and-drop supported (stable on all OS).
4. **Bulk Actions**:
   * Download selected/all attachments (zipped).
   * Delete selected (if permitted).
5. **Search/Filter/Sort**:
   * Search by file name.
   * Filter by Field Name, File Type, Date Added, File Name.
   * Sort by Field Name, File Type, Date Added, File Name (max 3 fields).
6. **Preview**:
   * Click to preview (supported for all file types).
   * Show image resolution for images.

#### 3.3 Attachments in Forms (Create/Update) <a href="#id-3.3-attachments-in-forms-create-update" id="id-3.3-attachments-in-forms-create-update"></a>

1. **Form Setup**:
   * Add attachment fields (single/multiple) to form.
   * Table fields can include attachment columns.
2. **User Submission**:
   * User uploads files via Upload or Gallery.
   * Multiple attachments allowed if field supports.
   * Autofill/default values not supported for table fields; clarify for other fields.
3. **Submission Handling**:
   * Attachments are saved at record level unless tied to a field.
   * Attachments must be visible in form submissions and record details.
   * Permissions enforced (Gallery/Upload hidden if not permitted).
4. **Edge Cases**:
   * Revoking View permission clears autofill/default attachments from UI.
   * Attachments deleted from one record remain in others unless unlinked everywhere.

#### 3.4 Attachment Permissions & Edge Cases <a href="#id-3.4-attachment-permissions-and-edge-cases" id="id-3.4-attachment-permissions-and-edge-cases"></a>

* **Permissions**:
  * View/Create/Delete enforced at field and role level.
  * Gallery/Upload hidden if Create not allowed.
  * Delete only if user has edit permission on all linked records.
* **Attachment Deletion**:
  * Deleting from one record only removes link from that record.
  * File remains in Global Attachments if linked elsewhere.
  * File is deleted globally only if unlinked from all records.
* **Feature Flag**:
  * Attachment-related UI/options hidden if feature flag is off.
* **File Types/Previews**:
  * Supported: Images (JPG, PNG, HEIF/HEIC, etc.), Audio (MP3, M4A, WMA, etc.), Video (MP4, 3GP, etc.), Documents (PDF, ZIP, CSV, etc.).
  * Unsupported formats show error or document preview modal.
  * File size displayed in correct units (KB/MB).
* Viewing Data:
* Pagination, search, filter, and sort update dynamically.
* Empty states and loading indicators shown as needed.
* All actions respect real-time permission changes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://prohelp.assetpanda.com/setting-up-the-organization/populating-data/attachments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
