Link Menu Expand (external link) Document Search Copy Copied

Attach File

Definition

The Attach File action in Smartsheet allows you to upload and append a file directly to a specific row within a sheet. This action is crucial for workflows that require associating documents, images, or reports with specific data records for better tracking and organization.

Key capabilities include:

  • Attaching files from previous workflow steps to a precise row.
  • Automating the process of document association, ensuring that all relevant files are stored alongside their corresponding data in Smartsheet without manual intervention.



Inputs

1. Connection

  • Purpose: Establishes the link between Zenphi and your Smartsheet account.
  • Practical Guidance: Select an existing connection from the list or create a new one to authorize Zenphi to access and modify your sheets.
  • Use Case Context: Ensures the automation has permission to upload files on your behalf.

2. Sheet id

  • Purpose: Identifies the specific Smartsheet where the target row is located.
  • Practical Guidance: Select the desired sheet directly from the dropdown menu that appears after the connection is set.
  • Use Case Context: You would use this to specify that the file should go into the “Q3 Expense Report” sheet.

3. Row Id

  • Purpose: Specifies the exact row within the selected sheet where the file should be attached.
  • Practical Guidance:
    • Static: You can manually find a Row ID by right-clicking a row in the Smartsheet web application, selecting “Properties,” and copying the value.
    • Dynamic (Recommended): Use a Create Row, Find Row, or List Rows action earlier in your flow to locate or generate a specific record, and then use the token picker to map that output here.
  • Use Case Context: Ensures a contract .pdf attaches specifically to “Client A’s” row, rather than just anywhere in the sheet.

4. File

  • Purpose: Accepts the actual file content you wish to upload.
  • Practical Guidance: Use the token picker to select a file payload from a previous step (such as a file received via a Form trigger, a generated document, or a file retrieved from Google Drive).
  • Use Case Context: You would use this to pass the actual Invoice.pdf file into the Smartsheet row.



Outputs

1. Attachment

  • Data Description: The unique identifier (ID) of the file that was just successfully attached to the row.
  • Workflow Utility: This ID is useful for verification purposes. For example, you could log this ID in a separate database or audit trail to cross-reference that the file was successfully added to Smartsheet.



Example Use Cases

1. Expense Receipt Archiving: Automatically attach receipt images submitted via forms to the corresponding expense entry in Smartsheet for auditing purposes.

2. Contract Management: Append signed contract .pdf files generated in previous workflow steps directly to the client’s record row for centralized access.

3. Incident Reporting: Attach photos, screenshots, or log files to a specific ticket row in an issue tracking sheet to provide context for support teams.

4. Employee Onboarding: Upload resumes, identity documents, or signed offer letters to a new hire’s row in the HR directory sheet.

5. Project Deliverables: Associate final project files or design assets with their specific task row in a project management sheet.



Example Scenario: Automated Expense Receipt Archiving

Goal

An employee submits a travel expense claim using a Zenphi Form. The form collects the expense details (amount, date, description) and requires an uploaded image of the receipt. You want to automatically record this data in an “Expense Tracker” Smartsheet and attach the receipt directly to that specific row.


Steps to Implement

1. Trigger Selection: Use a Zenphi Form trigger to start the workflow whenever a new expense claim is submitted.

2. Create the Record: Add a Create Row action (Smartsheet) to push the text details (Amount, Date, Description) from the form into the “Expense Tracker” sheet. Crucially, this step generates the specific Row ID for the new entry.

3. Configure the Attach File Action:

  • Connection: Select your authorized Smartsheet connection.
  • Sheet Id: Select “Expense Tracker” from the dropdown menu.
  • Row Id: Use the token picker to map the Row ID output from the Create Row step (Step 2). This ensures the file attaches to the entry that was just created.
  • File: Use the token picker to select the uploaded File payload from the Zenphi Form trigger (Step 1).


Outcome

Every time an expense is submitted, the workflow automatically logs the data and attaches the receipt image to the correct row. This eliminates manual data entry and file uploading, ensuring the finance team has immediate access to both the claim details and the supporting documentation.



Best Practices

1. Use Dynamic Row IDs: Always map the Row Id dynamically from a previous action (such as Create Row or Find Row) rather than hardcoding it. This ensures the file is attached to the correct, relevant record every time.

2. Handle Multiple Files (Loops): The Attach File action processes one file at a time. If your trigger allows multiple file uploads (e.g., a form with a multi-file attachment field), add a Foreach Loop to iterate through the collection of files, placing the Attach File action inside the loop to upload each one individually.

3. Verify File Availability: Ensure that the previous step actually contains a file payload before this action runs. You can use an If Condition to check if the file variable is not null to prevent workflow errors.

4. Check Sheet Permissions: Ensure the account used in the Connection field has at least “Editor” permissions on the target Smartsheet. Users with only “Viewer” permissions cannot add attachments via the API.