To generate a document from a template, we need to install and configure the op_generate_from_template_v2 operation in the space where we want to use it.
Once this operation is installed, we can configure the following parameters:
- Template uuid: Field that will contain the template “uuid”.
- Sign: Field that controls whether the generated document will be signed or not.
-
Generation mode: This field is a selector with two options:
“Generate main document from template” and “Generate related document from template“. The first option will update the document binary, overwriting it if it already exists. The second generates a related document. For this option, you must also fill in the following field, “Document type”.
- Document type: This field is a selector to indicate, in case you want to generate a related document, with which form the document will be created.
For the operation to work correctly, all fields, except “Document type”, must be filled in.