Otter Documentation

variables - Apply Template

  • Last Modified: 2020-06-26

This is generated from the built-in components of Otter 2.2, and may be different than what you have installed (especially if you have extensions); go to [User Icon] > Documentation within your Otter instance to see exactly what operations are available.

Apply Template

Applies full template transformation on a literal, a file, or a template asset.

Operation type:

Executing - this operation will perform a specified action or actions on a remote server.

Script usage:

InedoCore::Apply-Template(
	[Asset: <text>],
	[OutputVariable: <text>],
	[OutputFile: <text>],
	[Literal: <text>],
	[InputFile: <text>],
	[AdditionalVariables: <%(key1: value1, ...)>],
	[NewLines: <integer>]
);

Arguments:

Name Format Script Usage Usage Notes
Asset (default)
text
Asset
Store to variable
text
OutputVariable
Output file
text
OutputFile
Literal
text
Literal
Variables are not expanded within the contents of this property.
Input file
text
InputFile
Additional variables
%(key1: value1, ...)
AdditionalVariables
New lines
integer
NewLines

Note: When reading from or writing to a file, there must be a valid server context.

Example:

# applies the a literal template and stores the result in $text
Apply-Template
(
    Literal: >>Hello from $ServerName!
<% if $IsSimulation { %> This is a simulation run. <% } else { %> This is not a simulation run. <% } %>
Thanks,
$MyName
>>,
    OutputVariable => $text,
    AdditionalVariables: %(MyName: Steve)
);

Is this documentation incorrect or incomplete? Help us by contributing!

This documentation is licensed under CC-BY-SA-4.0 and stored in GitHub.

Generated from commit 46e90aca on master