Automatic Sync Captures to Newly Created Child Records using Flow (Admin-Oriented)
Overview
If a SharinPix Form has sections or repeated sections configured to generate new Salesforce records upon submission, Salesforce Admins can configure a Salesforce Flow to sync images captured in those sections to the SharinPix Albums of the newly created records.
This documentation explains how to configure your Flow accordingly. It covers the following :
Flow Configuration Guide
Demo of the flow
Flow Configuration Guide
The following flow setup uses a Record-Triggered Flow to automatically sync media captured to its related record's album when a form response is submitted.
Step 1: Configure a Record-Triggered Flow
Go to Setup > Flows > Click New Flow
Choose Start From Scratch and click Next
Choose Record-Triggered Flow and click Create
Set the following values:
Object
Sharinpix Form Response
Trigger
A record is created or updated
Set Entry Conditions
All Conditions Are Met (AND)
Set Entry Conditions configuration:
ProcessedAt
Is Null
False
Image Synced At
Is Null
False
Records Created At
Is Null
False
When to run the flow for updated records
Only when a record is updated to meet the condition requirements.
Optimize the Flow for
Actions and Related Records


Step 2: Add a Get Records to retrieve Form Sections with the created records.
Set the following values:
Object
SharinPix Form Answer
Filter SharinPix Form Answer Records
All conditions are met (AND)
(see table below for condition requirements configurations)
Sort Order
Not Sorted
How many records to store
All records
How to store record data
Automatically store all fields
Condition Requirements:
SharinPix Form Response
Equals
Triggering sharinpix__FormResponse__c > Record ID
Linked RecordId
Is Null
False

Step 3: Add a Loop to go through each section
Collection variable
Get Records > SharinPix Form Answers from Get Sections With A Created Record (Step 2)
Specify direction for iterating over collection
First item to last item

Step 4: Add a Get Records to capture answers in the sections
Set the following values:
Object
SharinPix Form Answer
Filter SharinPix Form Answer Records
See table below for condition requirements configurations
Sort Order
Not Sorted
How many records to store
All records
How to store record data
Automatically store all fields
Condition Requirements:
Condition Requirements
Custom condition logic is met
Conditional Logic
(1 OR 2) AND 3 AND 4
Condition logic:
SharinPix Form Section
Equals
Current item from loop for each section with a created record > Record Id
Form Repeated Answer
Equals
Current item from loop for each section with a created record > Record Id
InputType
Equals
sharinpix-app
Image URL
Is Null
False

Step 5: Add a Loop to go through every answer in the section
Collection Variable
SharinPix Form Answers from Get Capture Answers in Section (Step 4)
Specify direction for iterating over collection
First item to last item

Step 6: Add Apex Action SharinPix Duplicate Album
Add the Apex action sharinpix__DuplicateAlbum to the flow. For more information regarding this Apex action, refer to this documentationDuplicate a SharinPix album using a Flow (Admin-Oriented).
The final Flow should look like this:

Demo
In this demo, the SharinPix Form is configured with a repeating section 'On-Site Workers' that creates new contact records. Any images uploaded via the embedded capture element in those sections will automatically be duplicated to the albums of the newly created contacts.

Upon Form submission, the Flow automatically triggers and duplicates any images uploaded in the section directly to the related contact record's album.

Last updated
Was this helpful?

