# PDF Storage

Optionally store completed task PDFs (signed documents) directly in Salesforce.

## PDF Storage Setup

Configure PDF storage in the Onboarded™ Setup interface:

1. Navigate to **Onboarded™ Setup** tab
2. Go to **PDF Configuration** section
3. Enable **Store PDFs in Salesforce**
4. Choose your storage location preference
5. Save configuration


## Storage Options

### Salesforce Files

PDFs are stored as ContentDocument records in Salesforce Files.

**Pros:**

- Centralized document management
- Can be organized in folders
- Sharing and permissions via Salesforce


**Setup:** Create a folder in Files and specify it in the configuration.

### Employee Record

PDFs are attached directly to the related Employee record.

**Pros:**

- Documents automatically associated with employees
- Easy to find documents on employee record
- No folder management required


Beyond programmatic file retrieval through the API, completed task PDFs can also be viewed on demand from the Employee Onboarded and Workflow Onboarded components: when PDF Storage is enabled, completed task rows display a **View Document** button that opens the stored PDF in a new browser tab. See the Components page's Task Row Actions section for details.

## On-Demand File Download

When PDF storage is **disabled**, completed task documents remain stored in Onboarded™ and are not automatically synced to Salesforce. For organizations that prefer this approach (to conserve Salesforce storage or for compliance reasons), the **Task File Download** component provides on-demand access to these documents.

### Download Mechanics

- The component appears on completed Task records when PDF storage is disabled
- Users can view a list of available files for the task
- Clicking "Download" generates a temporary signed URL (valid for 5 minutes)
- Files are downloaded directly from Onboarded™ without being stored in Salesforce


### Task Record Page Setup

1. Navigate to **Setup** → **Object Manager** → **[Your Task Object]**
2. Click **Lightning Record Pages**
3. Edit or create a Lightning Record Page
4. Drag the **Task File Download** component onto the page layout
5. Save and activate the page


> **Visibility Conditions:** The component automatically hides itself when:
- PDF storage is **enabled** (files already sync to Salesforce)
- The task is not yet **completed** (no files to download)
- The record is not the configured **Task object**



> **Requirement:** The `completed_at` field must be mapped in your Task object field mappings for the component to detect completed tasks.