Apex can provide values to Gutenburg Input Fields using the same naming concept used with Salesforce Flow: define the value in Apex and create an Input Field in the template with the same name.
1. Define the value in Apex
Create or populate the Apex variable that should be available to the Gutenburg template.
The variable name matters because it is used to map the Apex-provided value to the corresponding Input Field.
2. Create the matching Input Field
In the Gutenburg template:
- Create a Data Field.
- Choose Input Field as the field type.
- Name the Input Field exactly the same as the variable used by Apex.
3. Insert the Input Field in the template
Add the Input Field wherever the Apex-provided value should appear in the generated document.
Naming example
If Apex supplies a value under the name myCustomInput, the Gutenburg template should contain an Input Field named myCustomInput.
