Text Template Variables

Skip to main content

Text Template Variables

You are here:

The Product Configurator includes replaceable parameters, known as text template variables, you can use to build the text for the configured item’s description, extended text, and comments. These variables dynamically insert attributes or characteristics from the configuration.

Syntax

Its syntax follows a template placeholder format (e.g., ) where:

  • The curly braces identify the token as a placeholder to be replaced with a resolved value.
  • The prefix OPTION identifies the option code from the configuration from which its attribute is retrieved.
  • The suffix .PROPERTY identifies the specific attribute to retrieve from the option.

When a property is not tied to a specific option, the OPTION prefix can be omitted (e.g., ).

Properties

Property Description
Name Returns the option’s description.
Choice Returns the choice code selected for the option.
ChoiceNo Returns the choice’s number.
Desc Returns the choice’s description.
ItemDesc Returns the choice’s item description text.
CfgDesc Returns the choice configured (or sub-configuration) description.
Quantity Returns the option’s quantity per unit.
UnitPrice Returns the option’s unit price.
LineAmount Returns the option’s line amount.
OptionText Returns the option text value for the option.

How it works

When building text, the text template variable is replaced at runtime with the value of the specified property from the referenced option. For example, if the configuration includes the option code LENGTH, then resolves to the description for the LENGTH option, resolves to the selected choice code, and resolves to the quantity per unit entered for that option.

Applications and use cases

You can use the text template variables in the following places:

  • The Configurator Item Category’s Item Description Template to build the configured item’s description.
  • The Option Choice’s Ext. Text Template to build the configured item’s extended text for the option choice.
  • The Option Choice Comment’s Comment Text Template to build the configured item’s comment text for the option choice.

Examples

  1. Item description:
    Suppose the configuration is designed for building a table where the user can freely enter the height and must select the material from a set list.It includes the following options:
    HEIGHT with a single default choice where the user enters the height as its quantity per unit.
    MATERIAL with choices OAK (Oak) and WAL (Walnut).

    Its Configurator Item Category's Item Description Template is:
    Table: ft,

    If the user enters 6 for the HEIGHT option's quantity per unit and selects the OAK choice for the MATERIAL option, the text template variables and resolve to 6 and Oak respectively. This results in the configured item's description to be:
    Table: 6ft, Oak

    If the user enters 10.5 for HEIGHT and selects WAL for MATERIAL, the variables resolve to 10.5 and Walnut, and the configured item's description will be:
    Table: 10.5ft, Walnut

  2. Extended text:
    Suppose the configuration is designed for building custom personal computers where the user selects a memory module and enters the number of units required.It includes the RAM (Computer Memory) option with choices 16GB (16GB module) and 32GB (32GB module).

    Both choices share the following Option Choice Ext. Text Template is:
    : x

    If the user selects 32GB for the RAM option and enters 1 for its quantity per unit, the text template variables , , and resolve to Computer Memory, 1, and 32GB module respectively. This results in the extended text for the option choice to be:
    Computer Memory: 1 x 32GB module

    If the user selects 16GB and enters 2, the variables resolve to Computer Memory, 2, and 16GB module, and the extended text will be:
    Computer Memory: 2 x 16GB module

  3. Option choice comments:
    Suppose the configuration is designed for cutting a sheet of metal or wood to specific length and width dimensions. The material is recorded in inventory as pieces or sheets, and the fractional value is already calculated and appears in the components list to satisfy the inventory requirements. For the shop floor to correctly cut the material they require the specific length and width dimensions. These details, or special instructions, can be passed from the configuration to the routing line comments using text template values and option choice comments.It includes the following options:
    LENGTH with a single default choice where the user enters the length as its quantity per unit.
    WIDTH with a single default choice where the user enters the width as its quantity per unit.
    OPERATION with a single default choice to represent the cutting operation to add as a routing line.

    The single choice in the OPERATION option includes an Option Choice Comment for the Routing Line where its Comment Text Template is:
    Cut material to cm x cm

    If the user enters 10 for the LENGTH option's quantity per unit and 12 for the WIDTH option's quantity per unit, the text template variables and resolve to 10 and 12 respectively. This results in the text for the routing line comment to be:
    Cut material to 10cm x 12cm

    If the user enters 25.75 and 15.5, the variables resolve to 25.75 and 15.5, and the routing line comment text will be:
    Cut material to 27.5cm x 15.5cm

Extend text template variables

Text template variables can be extended to include additional properties by subscribing to one of the following events in the IWX Configurator Text Mgt. codeunit:

Additional properties are added to the text template variables dictionary, keyed by option code, allowing them to be referenced in templates using syntax, or simply for properties not tied to a specific option.

The following example shows how to add a VariantCode property for each configuration option, making it available as in text templates:

Copy to Clipboard
Was this article helpful?
4.5 out Of 5 Stars

1 rating

5 Stars 0%
4 Stars 100%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Need help?

Leave A Comment

Table of Contents
Go to Top