Templating

Learn about OneFuse Templating to drive dynamic business logic.

Templating is when a user uses variables, with or without static text, to produce desired results using the OneFuse Template Engine.

Example

When requesting a VM, the requester is presented with a set of choices for the field Environment.

Using Templating, you can use the variable: Environment and apply further logic to create a dynamic result.

Code
{# Environment variable has two options on the request: "Development" and "Production" #}

{# Requester selects "Development" for Request 1 #}
{# We will print the variable Environment below #}

{{ Environment }}

=> "Development"

{# Requester selects "Production" for Request 2 #}
{# We will print the variable Environment below #}

{{ Environment }}

=> "Production"

{# Requester selects "Production" for Request 3 #}
{# You can further manipulate the variable using Filters #}
{#
We will print the variable Environment below with the "first" and "lower" filters
- The "first" Filter will get the first letter of the variable
- The "lower" Filter will lowercase the result of the variable after the previous filter is applied
#}

{{ Environment | first | lower }}

=> "p"

To learn more, refer to our Templating Guide.

Templating in Policies

Policies allow for templating where it matters to achieve sophisticated use cases quickly without lines of custom code.

When the Policy is executed from a Upstream Platform, script or self-service API call, the user can pass in properties to drive the desired configuration output.

To learn more, refer to Modeling Policies with Static Property Sets.

Previous TopicPolicy
Next TopicUpstream Platforms