# Import Form PDF to Album using Flow (Admin-Oriented)

## Overview

{% hint style="info" %}
The <mark style="color:$danger;">`ImportFormPdfAutomation`</mark> Invocable Apex method allows users to automatically import a PDF generated from a SharinPix Form Response into a designated [SharinPix Album Component](https://app.gitbook.com/s/5EvYRrLbUyvRh8o1jmMG/lightning-web-component/sharinpix-album-lwc). This can be used across various business scenarios where form submissions must be archived and associated with a record (e.g., sites, cases, inspections).

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. [ImportFormPdfAutomation's Input Parameters](#input-parameters)
2. [Form Setup](#flow-setup)
   * [Step 1: Configure a Record-Triggered Flow](#step-1-configure-a-record-triggered-flow)
   * [Step 2: Assign Variables for the Action](#step-2-assign-variables-for-the-action)
   * [Step 3: Add the Import Action](#step-3-add-the-import-action)
   * [Step 4: Save and Activate the flow](#step-4-save-and-activate)
3. [Demo: Fire Safety Inspection Example](#demo-fire-safety-inspection-example)
   {% endhint %}

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

Before configuring this automation, ensure the following:

* You have the latest **SharinPix Package** installed. You can follow [this guide](https://app.gitbook.com/s/i8tH1o5AHthxksYgF6ij/how-to-update-sharinpix-package-from-the-appexchange) 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](https://app.gitbook.com/s/5EvYRrLbUyvRh8o1jmMG/access-and-security/sharinpix-permission-sets).
* A form template has been created using the [SharinPix Form Template Editor](https://docs.sharinpix.com/forms/form-elements/sharinpix-form-template-editor) and has been set up using the [SharinPix Form Launcher](https://app.gitbook.com/s/5EvYRrLbUyvRh8o1jmMG/lightning-web-component/sharinpix-form-launcher).
  {% endhint %}

## Input Parameters

Below are the inputs required when using the <mark style="color:$danger;">`ImportFormPdfAutomation`</mark> invocable method in a Salesforce Flow. These parameters must be provided to successfully import the PDF into a SharinPix album.

| Parameter      | Description                                                                                                                                                                                                         |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| formResponseId | The ID of the <mark style="color:$danger;">`Form_Response__c`</mark> record from which the PDF will be imported. *(Required)*                                                                                       |
| albumId        | The ID of the SharinPix album where the PDF will be stored. This corresponds to the **destination record ID** , typically the record (e.g., Site, Inspection, or Case) to which the album is attached. *(Required)* |

## Flow Setup

This flow is setup using a **fire safety inspection** scenario as example.

### 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                  | PdfUrl                                                          |
| Operator               | Is Null                                                         |
| Value                  | False                                                           |
| When to Run            | Every time a record is updated and meets condition requirements |
| Optimize Flow For      | Actions and Related Records                                     |

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2Fjahol6trx9HMRXuG9TaK%2FClick%20on%20the%20\(12\).png?alt=media\&token=f52d05ec-c974-417b-9b7a-8fe0d3967fca)

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2Fnt3z5Lo7hs2aHWzj7W1p%2FForm%20Response%20PDF%20Content%20Doc%20\(8\).png?alt=media\&token=ba6cc8f2-c0ea-4d77-8944-251d293cc0dd)

This configuration ensures the Flow runs only when a new PDF is available.

### Step 2: Assign Variables for the Action

Use an **Assignment** element to prepare the values that will be passed to the invocable method.

In this fire safety inspection scenario, assume the album is stored, for example, on a related <mark style="color:$danger;">`Inspection__c`</mark> record.

| Variable           | Value                                             |
| ------------------ | ------------------------------------------------- |
| Album\_Id          | Triggering Form\_Response\_\_c > Parent Record ID |
| Form\_Response\_Id | Triggering Form\_Response\_\_c > Record ID        |

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2F7d4wxjIVHE9JzvtUvmZe%2FClick%20on%20the%20\(13\).png?alt=media\&token=bb6cd2cf-69b1-4eec-94dd-af7ca3a90dc8)

### Step 3: Add the Import Action

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

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?*](https://app.gitbook.com/s/i8tH1o5AHthxksYgF6ij/i-am-unable-to-save-a-flow-with-an-apex-action-after-the-salesforce-winter-26-release-what-should-i)
{% endhint %}

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

| Field            | Value              |
| ---------------- | ------------------ |
| Album ID         | Album\_Id          |
| Form Response ID | Form\_Response\_Id |

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2Fbo6hovRmj5Aw3M2TFPPp%2FClick%20on%20the%20\(14\)%20\(1\).png?alt=media\&token=9e1d306f-5e9d-4380-bcf2-d7c5d4d8bd6f)

This step ensures the inspection report PDF is imported directly into the correct album for the site or building.

### Step 4: Save and Activate

* Save the Flow
* Click **Activate** to begin automating PDF imports

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FmJAzgsmXRQYqK3wtqvby%2FClick%20on%20the%20\(15\)%20\(1\).png?alt=media\&token=0ca2ee15-a42c-42d1-a105-62f62554f185)

## Demo: Fire Safety Inspection Example

This example demonstrates importing the **fire safety inspection PDF** into the related site’s SharinPix album when a form is submitted.

* The diagram below demonstrates the PDF version of the form on the <mark style="color:$danger;">`Inspection__c`</mark> record's album.

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2F8LzDArOjELLvHhHBOU0a%2FClick%20on%20the%20\(17\).png?alt=media\&token=70409852-071d-4e4d-8c89-8371008522f3)

![](https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FMkwM2s1teEV6EoMSh34h%2FTemplate%20\(5\).png?alt=media\&token=1fe17a38-4e29-43a3-91f2-662a736416b4)
