Relay Pull Attachment Action
  • 13 Jan 2025
  • 2 Minutes to read
  • Dark
    Light

Relay Pull Attachment Action

  • Dark
    Light

Article summary

Available in Relay package version 1.25+

The RelayPullAttachmentAction, is used to pull a file attachment, including images, from a Relay Power-up form submission. Once downloaded, the action will automatically create a new Salesforce ContentDocument and link it to the specified object.

NOTE

This flow action, assuming the passed in properties are valid, will return a status of 202 which implies the request was accepted and a background job will be started to retrieve the attachment. Because, the attachment download occurs in a background job, any errors during this process will be written as a record to the RelayLog__c custom object.

Action Properties

Field

Description

RelayPowerups__c event

A Relay power-up event record of type “Powerups Data Artifact Available”. Typically, this is the record that triggered the flow. This event record contains specific details about the file attachment.

Description

A description of the file attachment. This will populated on the created ContentDocument record.

DocumentLink Share Type

The permission granted to the user of the shared file in a library. This is determined by the permission the user already has in the library. If this field is not provided, then the value of ‘V’ will be used.

Valid values are:

  • V — Viewer permission. The user can explicitly view but not edit the shared file. This is the default value if not provided.

  • C — Collaborator permission. The user can explicitly view and edit the shared file. You can retrieve the ShareType for ContentDocumentLink, but you can't create a ContentDocumentLink with a ShareType of C from an Apex trigger.

  • I — Inferred permission. The user’s permission is determined by the related record. For shares with a library, this is defined by the permissions the user has in that library. Inferred permission on shares with libraries and file owners is available in API versions 21.0 and later. Inferred permission on shares with standard objects is available in API versions 36.0 and later.

See Salesforce docs: ContentDocumentLink

Document Link Visibility

Specifies whether this file is available to all users, internal users, or shared users. If this field is not provided, then the default value of ‘AllUsers` will be used.

Valid values are:

  • AllUsers — The file is available to all users who have permission to see the file. This is the default value if not provided.

  • InternalUsers — The file is available only to internal users who have permission to see the file.

  • SharedUsers — The file is available to all users who can see the feed to which the file is posted. SharedUsers is used only for files shared with users, and is available only when an org has private org-wide sharing on by default. The SharedUsers value is available in API version 32.0 and later.

See Salesforce docs: ContentDocumentLink

Linked Entity Id

Required. This field identifies the Salesforce entity (record) that will be linked to the ContentDocument. For example, this could be the Id field of a Person Account object.

See Salesforce docs: ContentDocumentLink

Action Response Variable

This action returns a custom Relay object RelayPullAttachmentAction.PullAttachmentResponse.

Field

Description

statusCode

Valid values are:

  • 200 — Success

  • 202 — Accepted, the attachment has been queued up for download.

  • Any other value — Error pulling the attachment. Review the statusMessage field for more details.

statusMessage

If the action was successful, statusCode is 200, then this value will contain the text “Accepted”. Otherwise, this field will contain the reason for the failure.

Action Property Dialog


Was this article helpful?


ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence