Import Images from Form Response to Parent Object (Admin-Oriented)
Overview
The **DuplicateImagesAutomation** Invocable Apex method allows users 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:
Prerequisites
DuplicateImagesAutomation’s Input Parameters
Flow 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
Before configuring this automation, ensure the following:
You have the latest SharinPix Managed Package installed.
Refer to the Upgrade SharinPix Package article to confirm installation and version.
Users must have one of the following permission sets assigned:
SharinPix Admin or SharinPix User
Image Sync is configured on the Form Answer object.
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.
Destination Album ID
The 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 IDs
The list of SharinPix Image Public IDs that will be duplicated. (Required)
Duplicate Tags
Optional 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:
Object
SharinPix Image
Trigger
A record is created
Condition Requirements
All Conditions Are Met (AND)
Field
SharinPix Form Answer
Operator
Is Null
Value
False
Optimize Flow For
Actions and Related Records
Asynchronous Path
Enabled (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:
Resource Type
Variable
API Name
SharinPixImageID
Data Type
Text
Allow multiple values (Collection)
✅ Checked
Available for input
leave unchecked
Available for output
leave 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.
Label
Store Image ID
API Name
Store_Image_ID
Description
Store the Public Image ID of the SharinPix Image to be duplicated on the Parent record.
Variable Values
SharinPixImageID
Add
{!$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.
Label
Get Parent Record
API Name
Get_Parent_Record
Object
SharinPix Form Response
Condition Requirements
All Conditions Are Met (AND)
Field
Record ID
Operator
Equals
Value
{!$Record.sharinpix__FormAnswer__r.sharinpix__FormResponse__r.Id}( Triggering SharinPix Image > Form Answer > Form Response > Record ID )
How Many Records to Store
Only 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:
Destination Album ID
Get Parent Record → Parent Record Id
List of Image IDs
SharinPixImageID
Duplicate Tags
Not 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:
SharinPix automatically creates Form Answer and Form Response records in Salesforce.
Each photo uploaded becomes a SharinPix Image record linked to the corresponding Form Answer.
The Record-Triggered Flow detects the creation of these SharinPix Image records.
The flow retrieves the related Form Response , obtains the Parent record ID (the Inspection record), and calls the DuplicateImagesAutomation Apex Action.
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:

Last updated

