> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/enhanced-template-editor/advanced-data-user-input-variables.md).

# Advanced Data: User Input Variables

Learn how to define custom user inputs using advanced data variables and implement them within a Salesforce Screen Flow. This setup creates a modernized runtime prompt workflow, allowing users to manually provide on-the-fly data to populate a template before a document is generated.

#### Accessing the Advanced Data Panel

The advanced data configuration tools are located within the template editor interface. To access them:

1. Click the plus icon ![](/files/xWPAmanZr12xdJpqqHAj) to open the *Variables* panel. This panel serves as the primary entry point for all variable data.
2. Click the *Advanced Data* ![](/files/C34uUmNHB5Vdq5jcfwES) icon inside the *Variables* panel.

{% hint style="info" %}
The *Advanced Data* configuration panel will launch on the right side of the interface.
{% endhint %}

#### Creating a User Input Data Source

{% columns %}
{% column width="50%" %}

<figure><img src="/files/hrAiYwNokdmunoUK7ZAB" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="50%" %}

1. With the *Advanced Data* ![](/files/C34uUmNHB5Vdq5jcfwES) menu launched, select either the **Variables** tab.
2. Click on the **Click to add** **+** button to create a new user input variable.
3. Configure the user input:

* **Display Name:** Customize the name of your custom field.
* **Data Type:** Select a format from the picklist, text, number, date, datetime, and boolean (which can render as a checkbox).
* **Preview Value:** Set a default value that will be used in preview mode.

4. Click **Save**
   {% endcolumn %}
   {% endcolumns %}

{% hint style="info" %}
Need to make an update to a User Input variable? Simply navigate to the Advanced Data panel and click on the user input when the ![](/files/C34uUmNHB5Vdq5jcfwES) icon is visible.
{% endhint %}

#### Result

The new user input will immediately be available to use in the *Variables* panel under a new subcategory named *User Inputs*. This subcategory automatically aggregates all the custom user inputs you define for the current template.

***

#### Implementing User Inputs in Salesforce Flow Builder

Once your template variables are defined, you can leverage the S-Docs Invocable Actions library within a Salesforce Screen Flow to capture this information from users at runtime.

{% hint style="warning" %}
The S-Docs invocable actions are visible within the Salesforce Flow Builder to all users. However, these actions are only functional if automation is included as part of your S-Docs licensing plan.
{% endhint %}

#### Step-by-step instructions

{% columns %}
{% column width="41.66666666666667%" %}

<figure><img src="/files/xBEBvPWiSZDSNQ3hR0Ar" alt=""><figcaption><p>A basic example of a Screen Flow that collects and assigns user inputs in an S-Docs Template</p></figcaption></figure>
{% endcolumn %}

{% column width="58.33333333333333%" %}

1. **Retrieve the template variables:** Add the *Get Template User Inputs* action from the S-Docs library to your canvas. Configure the action by referencing your target S-Docs template and providing a distinct element label.

2. **Set up a loop:** Add a *Loop element* immediately after the initial action. Configure the loop to iterate through the collection of user inputs found in the first step. The flow will search for and process all your template's custom user inputs one by one.

3. **Create the user interface:** Inside the loop, add a *Screen element*. You must build a screen component within this block to ensure a UI element is presented to the end user. This allows the running user to manually enter the text, numerical data, or selections that the specific user input field expects.
   {% endcolumn %}
   {% endcolumns %}

4. **Map responses with assignments:** Add an *Assignment element* inside your loop. Use this element to connect each specific user response to its respective template user input field.

5. **Execute document generation:** After the loop finishes processing all inputs, add the *Generate S-Doc with Input* action as the final step of your flow. This action collects the current record ID, the target template, and all the manual input fields just submitted by the user.

#### Result

The document generation engine triggers, and those user input fields are resolved — or replaced — with the actual data provided during the flow to output a fully completed S-Doc.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.sdocs.com/sdocs/enhanced-template-editor/advanced-data-user-input-variables.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
