The S-Docs Runtime Prompts feature allows you to set up forms with questions for users to respond to during the document generation process. This form input can then be merged into the document and/or conditionally render certain sections of the document.
S-Docs also includes functionality built to leverage invocable SDK document generation using Screen Flow Prompts as an alternative to runtime prompts. Screen Flow Prompts provide the ability for admins to set up a screen flow, collect the inputs into a collection and populate the inputs onto the generated document.
How To Create A Basic Screen for ScreenFlow
Setup the Screen
- Go to Setup > Process Automation >Flows and Click New Flow
- Choose Screen Flow and click Create
Click the + sign below the start button and choose the Screen element
Click Done
Create the Collection Variable
A minimum of two variables are required. 1 collection variable and one variable for each screen input you wish to collect information from. These steps will show how to create the collection variable:
- Click on the Toggle Toolbox button
- Click on New Resource
Input the following values:
Field | Value |
---|---|
Resource Type | Choose Variable |
API Name | [Custom Variable Name] (userinputcollection) |
Data Type | Apex-Defined |
Allow multiple values (collection) | Checked |
Apex Class | SDOC.UserInput |
Availability Outside the Flow | Available for Input / Output Checked |
Create the Input Variable
- Click on the Toggle Toolbox button
- Click on New Resource
Input the following values:
Field | Value |
---|---|
Resource Type | Choose Variable |
API Name | [Custom Variable Name] (userinputtext) |
Data Type | Apex-Defined |
Allow multiple values (collection) | Unchecked |
Apex Class | SDOC.UserInput |
Availability Outside the Flow | Available for Input / Output Checked |
Create the Assignment
Click the + sign and Choose Assignment
Field | Value |
---|---|
Label | ScreenFlowPrompt |
API Name | ScreenFlowPrompt |
Userinput Merge Field
Field | Value |
---|---|
Variable |
[Custom Variable Name].mergeField
{!userinputtext.mergeField} |
Operator | Equals |
Value | Text String |
Userinput Variable
Field | Value |
---|---|
Value |
[MergeFieldLabel] (Merge field label used in your template source) |
Userinput value: Variable |
[Custom Variable Name].value {!userinputtext.value} |
Operator |
Equals |
Value | [Screen Component Variable] |
Userinput Collection
Field | Value |
---|---|
Variable |
{!userinputcollection} |
Operator | Add |
Value | [Apex-Defined Variable] |
Example
Add Action(s) to the Flow
- Click the + sign below the start button and choose Action
- Search for the S-Docs Category
- Choose Generate S-Docs With Input
Set Input Values for the Selected Action:
Field | Value |
---|---|
Label | [Action Label] |
API Name | [Action API Name] |
Object Id | [Base Record ID] |
Template Name or Id | [Template Name or Template ID] |
User Inputs |
[User Input Collection Variable] {!userinputcollection} |
Example
Adding Input Collection to Templates
Taking the collection of screen inputs and placing it into the template is simple!
- Identify the [MergeFieldLabel](s) created
- Place them into the template at the point that you wish to render the user input collected