> ## 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.

<Info>
  **Prerequisites**: A [Workflow](/workflows/overview) with an earlier step that produces a file, and a connected Salesforce account whose user can access the record and create files.
</Info>

<Steps>
  <Step title="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.

    <Frame>
      <img src="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" alt="Action picker filtered to Salesforce, showing the Upload File to Record action" width="1594" height="1718" data-path="images/reference/upload-file-to-salesforce-record-action-picker.png" />
    </Frame>
  </Step>

  <Step title="Connect your Salesforce account">
    If you haven't already, connect your Salesforce account to Cassidy. See [Connect Salesforce](/integrations/salesforce/overview) for details.

    <Frame>
      <img src="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" alt="Upload File to Record action asking you to connect a Salesforce account" width="1594" height="1718" data-path="images/reference/upload-file-to-salesforce-record-connect.png" />
    </Frame>
  </Step>

  <Step title="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.

    <Frame>
      <img src="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" alt="Object Type dropdown searched for Opportunity in the Upload File to Record action" width="1594" height="1718" data-path="images/reference/upload-file-to-salesforce-record-object-type.png" />
    </Frame>
  </Step>

  <Step title="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](/integrations/salesforce/look-up-record) action first, and reference its record ID here.</Tip>

    <Frame>
      <img src="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" alt="Record ID field using an Opportunity ID variable from the Workflow trigger" width="1594" height="1718" data-path="images/reference/upload-file-to-salesforce-record-record-id.png" />
    </Frame>
  </Step>

  <Step title="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.

    <Frame>
      <img src="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" alt="File field variable picker showing a Contract file from the Workflow trigger" width="1594" height="1718" data-path="images/reference/upload-file-to-salesforce-record-file.png" />
    </Frame>
  </Step>

  <Step title="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.

    <Frame>
      <img src="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" alt="Optional Title and Description fields filled in for the uploaded file" width="1594" height="1718" data-path="images/reference/upload-file-to-salesforce-record-title-description.png" />
    </Frame>
  </Step>
</Steps>

## 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

<AccordionGroup>
  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>
</AccordionGroup>

## Related

* [Look Up Salesforce Record](/integrations/salesforce/look-up-record)
* [Update Salesforce Record](/integrations/salesforce/update-record)
* [Find or Create Salesforce Record](/integrations/salesforce/find-or-create-record)
* [Salesforce for Workflows](/integrations/salesforce/workflows)


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