Import Images from Form Response to Parent Object (Admin-Oriented)

Overview

The DuplicateImagesAutomation Invocable Apex method allows administrators to automatically import or duplicate images uploaded in a SharinPix Form Response (via Form Answers) to the corresponding Parent record’s album (Salesforce Object from which the SharinPix Form was launched).

This automation ensures that all images captured through SharinPix Forms are automatically propagated to the related Parent Object (e.g., Case, Site, or Inspection), maintaining centralized visibility and data consistency.

This article covers the following:

  • DuplicateImagesAutomation’s Input Parameters
  • Form Setup
  • Step 1: Configure a Record-Triggered Flow
  • Step 2: Assign Variables for the Action
  • Step 3: Get Parent Record
  • Step 4: Add the Duplicate Image Action
  • Step 5: Save and Activate the Flow
  • Demo: Form Response to Parent Duplication Example
  • Prerequisites

Prerequisites

Before configuring this automation, ensure the following:

  1. You have the latest SharinPix Managed Package installed.
  2. Users must have one of the following permission sets assigned:
    • SharinPix Admin or SharinPix User
       
  3. Image Sync is configured on the Form Answer object.
     
  4. The Parent record (e.g., Case, Site, or Inspection) is linked through a Form Response lookup relationship.

Input Parameters

Below are the inputs required when using the DuplicateImagesAutomation invocable method in a Salesforce Flow.

These parameters must be provided for the duplication to execute successfully.

ParameterDescription
Destination Album IDThe ID of the parent record (album) where the image will be duplicated. Typically retrieved through the Form Response lookup to the Parent record. (Required)
List of Image IDsThe list of SharinPix Image Public IDs that will be duplicated. (Required)
Duplicate TagsOptional boolean value indicating whether image tags should also be duplicated. (Default: false)

Flow Setup

This flow configuration demonstrates how to import or duplicate images from a Form Response to its related Parent record using the SharinPix DuplicateImagesAutomation Apex Action.

Step 1: Configure a Record-Triggered Flow

  • Go to Setup → Flows → New Flow
  • Choose Record-Triggered Flow and click Create
  • Set the following values:
SettingValue
ObjectSharinPix Image
TriggerA record is created
Condition RequirementsAll Conditions Are Met (AND)
FieldSharinPix Form Answer
OperatorIs Null
ValueFalse
Optimize Flow ForActions and Related Records
Asynchronous PathEnabled (since an external Apex call is made)

This ensures that the Flow runs only when a new image linked to a Form Answer is created.

Step 2: Assign Variables for the Action

Before creating the Assignment element, you must first create a new resource that will hold the image IDs to be duplicated.

2.1 Create the Resource

  • In Flow Builder, click New Resource.
  • Set the following values:
SettingValue
Resource TypeVariable
API NameSharinPixImageID
Data TypeText
Allow multiple values (Collection)✅ Checked
Available for inputleave unchecked
Available for outputleave unchecked

This variable acts as a Text Collection Variable to store one or more SharinPix Image Public IDs.
The collection type is required because the DuplicateImagesAutomation Apex Action expects a list of image IDs, even if there is only one image.

2.2 Add the Assignment Element

Next, add an Assignment element to populate the variable you just created.

SettingValue
LabelStore Image ID
API NameStore_Image_ID
DescriptionStore the Public Image ID of the SharinPix Image to be duplicated on the Parent record.

Variable Values
 

VariableOperatorValue
SharinPixImageIDAdd{!$Record.sharinpix__ImagePublicId__c}( Triggering SharinPix Image Record > Image Public ID )

Step 3: Get Parent Record

Use a Get Records element to fetch the Parent Record ID through the Form Response.

SettingValue
LabelGet Parent Record
API NameGet_Parent_Record
ObjectSharinPix Form Response
Condition RequirementsAll Conditions Are Met (AND)
FieldRecord ID
OperatorEquals
Value{!$Record.sharinpix__FormAnswer__r.sharinpix__FormResponse__r.Id}( Triggering SharinPix Image > Form Answer > Form Response > Record ID )
How Many Records to StoreOnly the first record

Step 4: Add the Duplicate Image Action

Add an Action element that calls the SharinPix DuplicateImagesAutomation.

Important

Starting with the Salesforce Winter ’26 release, Apex Actions must be executed in the Asynchronous Path.
They can no longer be placed in the “Run Immediately” section of Record-Triggered Flows.

For more information, see:
Unable to save a flow with an Apex Action after the Salesforce Winter ’26 release – What should I do?

Set the following parameters:

FieldValue
Destination Album IDGet Parent Record → Parent Record Id
List of Image IDsSharinPixImageID
Duplicate TagsNot Included

Step 5: Save and Activate

  • Click Save
  • Name the flow clearly (e.g., Import Images from Form Response to Parent Object)
  • Click Activate

The flow is now ready to automatically replicate uploaded images from Form Responses (via Form Answers) to the associated Parent record album.

Demo: Importing Images from Form Response to Parent (Inspection Example)

This example demonstrates how the flow automatically imports images submitted through a SharinPix Form into the related Inspection record’s SharinPix album in Salesforce.

Scenario

A field technician launches a “Site Safety Inspection” form from an existing Inspection record in Salesforce.
During the inspection, the technician captures several photos (e.g., of fire extinguishers, emergency exits, and signage) directly in the form.

When the form is submitted:

  1. SharinPix automatically creates Form Answer and Form Response records in Salesforce.
  2. Each photo uploaded becomes a SharinPix Image record linked to the corresponding Form Answer.
  3. The Record-Triggered Flow detects the creation of these SharinPix Image records.
  4. The flow retrieves the related Form Response, obtains the Parent record ID (the Inspection record), and calls the DuplicateImagesAutomation Apex Action.
  5. The Apex Action duplicates each image from the Form Answer level to the Inspection record’s SharinPix Album.

Result in Salesforce

Once the flow completes:

  • The images appear automatically under the Inspection record’s album in SharinPix.
  • The same images remain visible within each corresponding Form Answer for traceability.
  • No manual upload or linking is required.

Form launched from Inspection record:

Images automatically displayed in the Inspection’s SharinPix album:

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.