# How To: Document Refresh

Use this guide when you want a **Flow** to refresh an existing S-Docs document.

This pattern works well when your Flow needs to update document data after the source record changes, without generating a separate file.

{% hint style="info" %}
Before you start:

* Use a **Flow** that can run the S-Docs document refresh action
* Activate and test the Flow in Salesforce
* Make sure the Flow can access the target **SDoc** record
* Use an existing generated **SDoc** record to refresh
* If the Flow generates the document earlier, store the generated **SDoc ID** from that step
* Refresh updates the existing document as a new version
  {% endhint %}

### Configure the action in Flow

{% stepper %}
{% step %}

#### Step 1 — Add the action element

Add an **Action** element to the Flow.

Choose the S-Docs 'Refresh Document Data' action.

<figure><img src="/files/LYqT3LxorAGrM7ckO3iy" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Step 2 — Set the required values

Map the generated **SDoc ID** into the refresh action.

If the document was generated earlier in the Flow, use the output from that step.

<figure><img src="/files/QutBdOGrt2Qh8DUjW0Sb" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Step 3 — Save, activate, and test

Run the Flow and confirm it:

* refreshes the expected **SDoc** record
* updates the document with current Salesforce data
* creates a new version of the same document
  {% endstep %}
  {% endstepper %}

### What refresh does

Document refresh updates the existing generated document with the latest Salesforce data.

* It does not re-select or re-generate the template.
* It keeps the same document and creates a new version.
* The original structure and formatting remain unchanged.
* If version history is enabled, earlier versions remain available for reference.

### When to use document refresh

Use document refresh when:

* the source record changed after generation
* pricing, dates, or status values were updated
* the document should stay tied to the same **SDoc** record
* users need the latest data before emailing or sending for e-Signature
* you want updated data without generating a separate file

### Considerations

* Refresh data does not fully regenerate the document
* The original template and formatting remain unchanged
* Refreshing creates a new version, not a separate file
* Version history is visible only if **Show Versions** is enabled
* Runtime Prompts and Job Splitters are not supported

### Related guides

* [How To: Refresh Document Data Within the Documents](/sdocs/automation-and-document-lifecycle/workflows/refresh-document-data-within-the-documents-s-docs-lwc.md)
* [How To: View Document Versions in the Documents LWC](/sdocs/automation-and-document-lifecycle/workflows/view-document-versions-in-the-documents-lwc.md)
* [How To: Email Generation](/sdocs/automation-and-document-lifecycle/automate-with-flow/how-to-email-generation.md)
* [How To: Live Edit with Flows](/sdocs/automation-and-document-lifecycle/automate-with-flow/how-to-live-edit-with-flows.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/sdocs/automation-and-document-lifecycle/automate-with-flow/how-to-document-refresh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
