Relay Pull PDF Action
  • 13 Jan 2025
  • 3 Minutes to read
  • Dark
    Light

Relay Pull PDF Action

  • Dark
    Light

Article summary

Available with Relay package version 1.24+

The RelayPullPDFAction is used to pull a PDF document generated from a Relay Power-up form submission. Once downloaded, a ContentDocument link to the specified linkedEntityId will be created.

NOTE

This flow action starts a background job that preforms the actual downloading of the PDF. If an error occurs in this job, a record will be created on the RelayLog__c custom object.

Action Dialog

sfdc-flow-action-pull-pdf

Action Input Values

Field

Description

clientId

Optional.

The Send via future flow action input instructs the Relay action on how to make the callout. If set to True, the action will make the callout in an apex future. If set to False, the action will make the callout in the normal path. If the action is already running as a scheduled flow, or in the asynchronous branch of the flow, you are technically already running in a future so you can always pass in a value of False. Leveraging a future is useful to prevent delays in processing of the flow's primary logic.

Valid values are:

  • {!$GlobalConstant.False} = Run the action in the current flow process.

  • {!$GlobalConstant.True} = Run the action in a future.

description

A description for the ContentDocument

documentLinkShareType

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.

  • 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

documentLinkVisibility

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.

  • 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

linkedEntityId

Optional. If the shouldCreateDocument field is set to {!$GlobalConstant.True}, then this field must also be provided. This field identifies the Salesforce entity (record) that should be liked to the ContentDocument. For example, this could be the Id field of a Person Account object.

See Salesforce docs: ContentDocumentLink

shouldCreateDocument

Specifies if the action should create a ContentDocument and ContentDocumentLink to the entity identified by the value in the linkedEntityId field. If this field value is not provided then a default value of {!$GlobalConstant.False} will be used.

Valid values are:

  • {!$GlobalConstant.False} — Run the action in the current flow process.

  • {!$GlobalConstant.True} — Run the action in a future.

submissionId

Required. The Relay Power-up form submission ID. This identifies the PDF that should be downloaded.

title

A title for the ContentDocument.

Action Response Variable

The action returns a custom Relay object RelayPullPDFAction.PullPDFResponse.

Field

Description

contentDocId

If the shouldCreateDocument request field was set to True and the action was successful, then this field will contain the Id of the ContentDocument record that was created.

See Salesforce docs: ContentDocument

contentDocLinkId

If the shouldCreateDocument request field was set to True and the action was successful, then this field will contain the Id of the ContentDocumentLink record that was created. This is the link that was made between the ContentDocument and the entity identified by the linkedEntityId field in the request object.

See Salesforce docs: ContentDocumentLink

contentVerId

If the shouldCreateDocument request field was set to True and the action was successful, then this field will contain the Id of the ContentVersion record that was created. Salesforce automatically creates a DocumentVersion for every document.

See Salesforce docs: ContentVersion

pdfBlob

A Blob object that contains the binary PDF data.

IMPORTANT

This field will only be populated when the request field shouldCreateDocument is set to {!$GlobalConstant.False}.

See Salesforce docs: Blob Class

statusCode

Valid values are:

  • 200 —  Success

  • 425 — PDF Generation is delayed. Try and pull it again.

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

statusMessage

If the action was successful this value will contain the text “OK”. Otherwise, this field will contain the reason for the failure.


Was this article helpful?


ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence