# Import Form PDF as Content Document using Flow (Admin-Oriented)

## Overview

{% hint style="info" %}
The <mark style="color:red;">`FormResponseContentDocAutomation`</mark> Invocable Apex method allows users to automatically import a PDF generated from a SharinPix Form Response into Salesforce as a Content Document.

This invocable method is designed for use in Salesforce Flows and is compatible with automation for different types of form workflows.

This article covers the following :

1. [FormResponseContentDocAutomation's Input Parameters](#input-parameters)
2. [Flow Setup](#flow-setup)
   * [Step 1: Configure a Record-Triggered Flow](#step-1-configure-a-record-triggered-flow)
   * [Step 2: Add the Import Action](#step-2-add-the-import-action)
   * [Step 3: Save and Activate the flow](#step-3-save-and-activate)
   * [Step 4: Fill and Submit Form](#step-4-fill-and-submit-the-form)
     {% endhint %}

{% hint style="warning" %}
**Prerequisites**

Before configuring this automation, ensure the following:

* You have the latest **SharinPix Package** installed. You can follow [this guide](/faqs/how-to-update-sharinpix-package-from-the-appexchange.md) to upgrade your SharinPix Managed Package to the newest version.
* Users must have the **SharinPix Forms** **Admin** or **SharinPix Forms User** permission set assigned. For more information on these two permission sets, check [SharinPix Permission Sets](/documentation/access-and-security/sharinpix-permission-sets.md).
* A form template has been created using the [SharinPix Form Template Editor](/forms/form-elements/sharinpix-form-template-editor.md) and has been set up using the [SharinPix Form Launcher](/documentation/lightning-web-component/sharinpix-form-launcher.md).
  {% endhint %}

## Input Parameters

Below are the inputs required when using the <mark style="color:red;">`FormResponseContentDocAutomation`</mark> invocable method in a Salesforce Flow. These parameters must be provided to successfully import the PDF as a Content Document on Salesforce.

| Parameter            | Description                                                                                                               |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| formResponsePublicId | The ID of the <mark style="color:red;">`Form_Response__c`</mark> record from which the PDF will be imported. *(Required)* |
| recordId             | The ID of the Salesforce Record the Content Document will be linked to. (*Required)*                                      |
| filename             | The Filename to be assigned to the Content Document.                                                                      |

## Flow Setup

This flow is setup to be triggered when a SharinPix Form Response record is updated with a value set for PdfUrl\_\_c and does the following:

* Generates a Content Document of the response
* Imports the Content Document on Salesforce
* Links it to the Form Response's parent record

### Step 1: Configure a Record-Triggered Flow

1. Go to **Setup** > **Flows** > Click **New Flow**
2. Choose **Record-Triggered Flow** and click **Create**
3. Set the following values:

| Setting                | Value                                                            |
| ---------------------- | ---------------------------------------------------------------- |
| Object                 | SharinPix Form Response                                          |
| Trigger                | A record is created or updated                                   |
| Condition Requirements | All Conditions Are Met (AND)                                     |
| Field                  | ProcessedAt                                                      |
| Operator               | Is Null                                                          |
| Value                  | False                                                            |
| When to Run            | Only when a record is updated to meet the condition requirements |
| Optimize Flow For      | Actions and Related Records                                      |

![](/files/uEN2hcqiKkPd13UcXdzH)

![](/files/BDbQwOL5KZYfHlSJ60tZ)

This configuration ensures the Flow runs only when the `ProcessedAt` field on the [SharinPix Form Response](/forms/salesforce-integration/sharinpix-form-response.md) has a value.

### Step 2: Add the Import Action

{% hint style="danger" %}
**Alert:**

Starting with the Salesforce **Winter’26 release** , Apex Actions can no longer be executed directly in the **Run Immediately** path of a record-triggered flow. Instead, they must be placed in an **asynchronous path** , as the synchronous execution option is no longer supported.

For more details, please refer to the documentation here:\
[*Unable to save a flow with an Apex Action after the Salesforce Winter ’26 release – What should I do?*](/faqs/i-am-unable-to-save-a-flow-with-an-apex-action-after-the-salesforce-winter-26-release-what-should-i.md)
{% endhint %}

1. Add an **Action** element
2. Search for <mark style="color:red;">`Sharinpix__FormResponseContentDocAutomation`</mark>
3. Set the input values:

| Field                                                             | Value                                                                     |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------- |
| Salesforce record ID to which the Content Document will be linked | <mark style="color:red;">`{!$Record.sharinpix__ParentRecordId__c}`</mark> |
| SharinPix Form Response Public ID                                 | <mark style="color:red;">`{!$Record.sharinpix__PublicId__c}`</mark>       |
| Filename of the Content Document                                  | <mark style="color:red;">`{!$Record.Name}`</mark>                         |

![](/files/kzvx77MheNCM9iAsyJtC)

This step ensures the inspection report PDF is imported directly into the Salesforce Record where the form was launched.

### Step 3: Save and Activate

* Save the Flow
* Click **Activate** to begin automating PDF imports as Content Documents.

![](/files/C2MgT8cZkvnIVaWHMXf6)

### Step 4: Fill and Submit the Form

Once the form has been submitted with the value set for PdfUrl\_\_c, the Content Document is generated and linked to the salesforce record were the form was launched's Notes & Attachments section.

![](/files/2B72xp2AlBryeCMdYZI1)

![](/files/kYJC2NyMSXc4C4qInih1)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sharinpix.com/forms/form-pdf-configuration/import-form-pdf-as-content-document-using-flow-admin-oriented.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
