Refresh Generated Documents with Flow
Refresh an existing SDoc from Flow so it pulls the latest Salesforce data and saves the update as a new version.
Refresh an existing SDoc from Flow so it pulls the latest Salesforce data and saves the update as a new version.
Use this guide when you want a Flow to update an existing generated S-Doc.
Use this pattern when the source record changed and you want a new version, not a new file.
Refresh updates the same SDoc record.
S-Docs saves the update as a new version.
Refresh does not fully regenerate the document.
Runtime Prompts and Job Splitters are not supported.
New to Flow? Start with Getting Started: Automate Document Generation.
A Flow that can run S-Docs actions
An existing generated SDoc record to refresh
Access to the target SDoc record
A way to store or retrieve the generated SDoc ID before the refresh step runs
Open Flow Builder.
Add an Action element.
Choose Refresh Document Data.
Enter a Label and API Name.

Map the generated SDoc ID into the required action input.
If the document was generated earlier in the Flow, use the ID returned by that step.
If the document already exists, use a stored value or a prior Get Records step.

Click Done. Then save and activate the Flow.
Run the Flow and confirm it refreshes the expected SDoc.
Confirm the document shows current Salesforce data.
Confirm S-Docs creates a new version of the same document.

Symptom: The refresh action errors or the Flow goes down the Fault path.
Cause: The mapped sdocId value is blank, invalid, or does not point to a generated SDoc record.
Fix: Check the resource you mapped into the action. Confirm it stores a valid generated SDoc Id. If needed, add a Fault path so the Flow surfaces the exact error during testing.
Symptom: The action finishes, but it updates a different document than expected.
Cause: The Flow mapped the wrong SDoc record ID into the action.
Fix: Review the step that stores the document ID. Confirm the correct SDoc Id is passed into the action before refresh runs.
Symptom: The original document changes instead of a separate file being created.
Cause: Refresh updates the existing SDoc by design.
Fix: Use a document generation action when you need a separate output file.
Field-level action details: Flow Reference
Action API name: SDOC__RefreshDocumentDataInvocable
SDoc ID — Required. Pass the generated SDoc record ID you want to refresh.
The action updates the existing generated document with current Salesforce data.
The action does not re-select the template.
The action does not create a separate file.
The original layout and formatting remain unchanged.
To let users view earlier versions on the record page, enable Show Versions in the Documents (S-Docs) component. For that setup, see View Document Versions in the Documents LWC.
Was this helpful?

