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:

  1. Create a Data Field.
  2. Choose Input Field as the field type.
  3. 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.