> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cassidyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload file to Salesforce record

> Attach a file from your Workflow to a Salesforce record, such as a contract, report, or call recording, so it appears in the record's Files.

The Upload File to Record action attaches a file to an existing Salesforce record. Use it to save a generated proposal on an Opportunity, attach a signed contract to an Account, or store a call transcript on a Contact.

The file appears in the **Files** section of the record in Salesforce.

> [!NOTE]
>
> **Prerequisites**: A [Workflow](https://docs.cassidyai.com/workflows/overview.md) with an earlier step that produces a file, and a connected Salesforce account whose user can access the record and create files.

**1. Add the Upload File to Record action**

While editing a Workflow, click the **+** button between existing steps. Select **Upload File to Record** from the Salesforce actions to add it to your Workflow.

![Action picker filtered to Salesforce, showing the Upload File to Record action](https://mintcdn.com/cassidy/2MsxK_HYe3z4Tc46/images/reference/upload-file-to-salesforce-record-action-picker.png?fit=max\&auto=format\&n=2MsxK_HYe3z4Tc46\&q=85\&s=b647ea053a1dd42d866b8b80f46cf2de)

**2. Connect your Salesforce account**

If you haven't already, connect your Salesforce account to Cassidy. See [Connect Salesforce](https://docs.cassidyai.com/integrations/salesforce/overview.md) for details.

![Upload File to Record action asking you to connect a Salesforce account](https://mintcdn.com/cassidy/2MsxK_HYe3z4Tc46/images/reference/upload-file-to-salesforce-record-connect.png?fit=max\&auto=format\&n=2MsxK_HYe3z4Tc46\&q=85\&s=336da2a6c1dd421153034e851c87b90b)

**3. Select the object type**

Use the **Object Type** dropdown to choose the kind of record you're attaching the file to, such as **Account**, **Contact**, **Opportunity**, **Lead**, **Case**, or a custom object.

![Object Type dropdown searched for Opportunity in the Upload File to Record action](https://mintcdn.com/cassidy/2MsxK_HYe3z4Tc46/images/reference/upload-file-to-salesforce-record-object-type.png?fit=max\&auto=format\&n=2MsxK_HYe3z4Tc46\&q=85\&s=34168f47a51df3edc9056a75afe042f1)

**4. Enter the record ID**

In **Record ID**, enter the ID of the record to attach the file to. Salesforce record IDs are 15 or 18 characters long.

> [!TIP]
>
> Use a variable from your trigger or an earlier step. For example, add a [Look Up Salesforce Record](https://docs.cassidyai.com/integrations/salesforce/look-up-record.md) action first, and reference its record ID here.

![Record ID field using an Opportunity ID variable from the Workflow trigger](https://mintcdn.com/cassidy/2MsxK_HYe3z4Tc46/images/reference/upload-file-to-salesforce-record-record-id.png?fit=max\&auto=format\&n=2MsxK_HYe3z4Tc46\&q=85\&s=572f9a5012a2442879b452ba7415eedb)

**5. Select the file**

In **File**, choose the file variable to upload from a previous step. Files can be up to 500MB.

This action uploads one file per run. If a variable contains several files, use a loop to upload each one.

![File field variable picker showing a Contract file from the Workflow trigger](https://mintcdn.com/cassidy/2MsxK_HYe3z4Tc46/images/reference/upload-file-to-salesforce-record-file.png?fit=max\&auto=format\&n=2MsxK_HYe3z4Tc46\&q=85\&s=8ae601576edabf245a88c11f0375993b)

**6. Set a title and description (optional)**

In **Title (Optional)**, enter the name the file should have in Salesforce. If you leave it empty, Cassidy uses the original file name. A title can be up to 255 characters.

In **Description (Optional)**, add a note that appears with the file in Salesforce.

![Optional Title and Description fields filled in for the uploaded file](https://mintcdn.com/cassidy/2MsxK_HYe3z4Tc46/images/reference/upload-file-to-salesforce-record-title-description.png?fit=max\&auto=format\&n=2MsxK_HYe3z4Tc46\&q=85\&s=6a235fc795230dbbb25762103f97babf)

## Output variables

Later steps in your Workflow can use these values.

| Variable | Description |
| - | - |
| **Content Version ID** | The ID of the file version created in Salesforce. |
| **Content Document ID** | The ID of the file in Salesforce. |
| **Record ID** | The ID of the record the file was attached to. |
| **File Name** | The name the file was saved with: your title if you set one, otherwise the original name. |

## Troubleshooting

> **The action says it can't upload the file to the record**
>
> **Why this happens**: The Salesforce user connected to Cassidy may not have access to the record, may not be allowed to create files, or the record ID may not match the selected object type.
>
> **Fix**: Check that the record ID is correct and that **Object Type** matches the record. Then confirm the connected Salesforce user can open the record and add files to it in Salesforce.

> **The action says the file is too large**
>
> **Why this happens**: Files over 500MB can't be uploaded.
>
> **Fix**: Use a smaller file or split it into several files, then upload each with a loop.

> **The file uploaded but I can't see it on the record**
>
> **Why this happens**: The **Files** section may not be on the record's page layout, or your Salesforce user may not have permission to see the file.
>
> **Fix**: Open the record in Salesforce and check the **Files** related list. Ask your Salesforce admin to add it to the page layout if it's missing.

## Related

* [Look Up Salesforce Record](https://docs.cassidyai.com/integrations/salesforce/look-up-record.md)
* [Update Salesforce Record](https://docs.cassidyai.com/integrations/salesforce/update-record.md)
* [Find or Create Salesforce Record](https://docs.cassidyai.com/integrations/salesforce/find-or-create-record.md)
* [Salesforce for Workflows](https://docs.cassidyai.com/integrations/salesforce/workflows)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.