Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

...

You can use this Snap to download a file attached to a Salesforce object record automatically by passing an Attachment ID or Content Data ID.

Note

Multiexcerpt include macro
macro_uuid17f81579-d4be-4e1e-b886-67fe671fd058
nameSalesforce objects limitation
templateDataeJyLjgUAARUAuQ==
pageSalesforce Batch Create
addpanelfalse

...

Prerequisites

A valid Salesforce account with the required permissions.

...

Works in Ultra Pipelines.

Limitations

...

None.

Known Issues

None.

Snap Input and Output

...

Input/Output

...

and Known Issues

Multiexcerpt include macro
macro_uuid875414e1-db45-420d-804b-479a54164bea
nameSalesforce objects limitation
templateDataeJyLjgUAARUAuQ==
pageSalesforce Batch Create
addpanelfalse

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

  • Min: 0

  • Max: 1

  • Mapper

  • Salesforce Read or Salesforce SOQL Snap with

Structure
  • Mapper Snap to prepare a document stream of Attachment ID's.

A stream of documents which supply values to evaluate the ID expression.

Output

Document

  • Min: 1

  • Max: 1

  • Document to Binary

  • Binary to Document
    • Mapper Snap

    Document data with a byte array value for the "content" key and  also with a "ContentType" key

    /

    -value pair.

    Error

    The error view contains error, reason, resolution and stack trace. For more information, see Error Handling.

    Snap Settings

    Field Name

    Field Type

    Description

    Label*

    String

    Specify a unique and meaningful name for the Snap.

    You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline.

    Default Value: Salesforce Download
    ExampleSalesforce Download

    Service Version*

    String/Suggestion

    Specify the version number associated with the Salesforce service that you want to connect to. Alternatively, click the Suggestion (blue star) icon to fetch the list of versions and select the desired version.

    Default Value: 52.0 
    Example: 52.0

    File Type*

    String/Expression/Suggestion

    Specify the type of file you want to download. Alternatively, click the Suggestion (blue star) icon to fetch the list of associated files.

    Info

    You can also specify an

    (JavaScript)

    expression that will be evaluated into an attachment ID or content data ID, from each input document. The ID is found at the end of the URL of the file.

    The available options are:

    • Attachment: Downloads the file as an attachment.

    • Content Version: Downloads the version of the content.

    • Document: Downloads the file as a document.

    Default Value: Attachment
    Example: Document

    ID*

    String/Expression

    Specify the ID of the

    Salesforce

    object that you want to download.

    Default Value: N/A
    Example: $id

    Snap Execution

    Dropdown list

    Select one of the three modes in which the Snap executes. Available options are:

    • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

    • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

    • Disabled: Disables the Snap and all Snaps that are downstream from it.

    Default Value: Validate & Execute
    Example: Execute only

    Troubleshooting

    Error

    Reason

    Resolution

    404 Error: The requested resource could not be found.

    The

    external

    ID field does not exist or is not accessible.

    The input data should be valid. Check if your input data is valid.

    Example

    Downloading a Document from Salesforce and Converting into Binary Format

    We can download documents attached to Salesforce objects an attachment and convert them into binary format. This example demonstrates how we can use the Salesforce Download Snap to accomplish this task.

    ...

    First, we configure the Salesforce Download Snap to download the attachment bearing the Attachment ID 00P2i000002JKFcEAO.

    ...

    Upon validation, we see the following output in the Snap’s preview.

    ...

    Snap

    ...

    Output

    ...

    ...

    Next, we configure the Document to Binary Snap to convert the content value in the input document (attachment) to binary data at the output view.

    ...

    Download this Pipeline.    

    Downloads

    Info
    1. Download and import the Pipeline into SnapLogic.

    2. Configure Snap accounts as applicable.

    3. Provide Pipeline parameters as applicable.

    Attachments
    patterns*.slp, *.zip
    sortByname

    Snap Pack History

    ...

    See Also

    Salesforce Snap Pack

    ...