template

Modified on Thu, 9 Jul at 10:50 AM

template

TABLE OF CONTENTS

Insert one document into another

Definition

string template(string $id, string $stage, object $data)

Generate a Documotor document by finding the recipe with ID $id on stage $stage, and generating a document from it based on $data. The document is outputted as a base64 string. This document is referred to as a text element, and can be inserted into your current template by using a TextElement or a SlideElement binding.

Parameters

string $id

ID of the recipe that needs to generate the document. Can be found in the URL when the recipe is open, as the portion of the URL following the last slash.

string $stage

The stage of the recipe for the document that needs to be inserted. Set to null if template has no stage.

object $data

JSON object to provide as the input data for generation of the document from the recipe.

Returns

string

The base64 representation of the generated document. Can be inserted into a document with a TextElement or a SlideElement binding in Word or PowerPoint respectively.

Examples

Transformation
{
  a: template('65367b97833eb0d06f3eca1f', '626252489afd95fbc534d345', @)
}
Result
{
  a: "UesDBBQABggIAAAAIQAjAicNcGEAA10GAAATAAgCW0N..."
}

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article