Including Dynamic Information in Text Sections
Text sections can be customized with dynamic information from configured items, transactions, and your account. Dynamic information takes the form of resolve expressions and placeholders added to the HTML Content field. You can also add dynamic content when the text section introduces a table.
The type of dynamic information you can add to text sections depends on:
-
The parent group frequency.
You can find this information in the Repeat field on the group.
-
The line items for which the section is repeated.
You can find this information in the Run For field on the section.
For more information about the available resolve expressions and placeholders, see:
Including Dynamic Information from Configured Items
In text sections, you can include dynamic information from configured items through placeholders and resolve expressions. Resolve expressions can be used when the parent group is repeated for:
-
every configuration
-
every configured or additional line item
The following table summarizes the option combinations that admit resolve expressions.
Resolve Expressions |
Repeat Field (Group Record) |
Run For Field (Section Record) |
---|---|---|
|
Every Item |
|
Every Config |
— |
The Generic Items option stands for additional items.
You can also use the following predefined answers as resolve expressions:
-
SOLE/QUANTITY – The quantity of the configured item.
The value is sourced from the Quantity field on the product user interface.
-
SOLE/TOTAL_PRICE – The price of the configured item multiplied by the quantity.
The value is sourced from the Total field on the product user interface.
-
SOLE/MAT_PRICE – The price of a single configured item.
The value is sourced from the Unit field on the product user interface.
For more information about resolve expressions and predefined answers, see Obtaining Answer Data with Resolve Expressions and Including Additional Conditions in Rules and Actions with Predefined Answers.
The following table summarizes available placeholders to add dynamic information from configured items.
Placeholder |
Description |
Repeat Field (Group Record) |
Run For Field (Section Record) |
---|---|---|---|
{$CPI} |
Returns the preview image for the configured item. |
Every Item |
Configured Items |
Every Config |
— |
Repeating Text Sections Containing Dynamic Information from Configured Items
Dynamic information from configured items can be sourced for sections repeated for every configured item or every configuration.
When working with text sections, you can enter content that will be filled in with data from configured items. Data can be sourced from a qTable question or an input box text field or box storing an array of JSON objects.
The text will repeated:
-
for each row in the qTable question
-
or for each object in the array
For more information about qTables and input box questions, see QTable Questions and Input Box Questions.
The syntax for the array of JSON objects is:
[
{
"property1":"value",
"property2":"value",
"property3":"value"
},
{
"property1":"value",
"property2":"value",
"property3":"value"
},
{
"property1":"value",
"property2":"value",
"property3":"value"
}
]
You can add as many properties as required in each object.
To repeat a text section with configured item data:
-
Open the section record for editing.
-
In the Repeat Data Block field, select whether you want to repeat the content depending on the number of:
-
rows in the qTable question.
-
JSON objects in the array.
-
-
If you selected JSON in step 2:
-
In the JSON Q/A field, enter the NetSuite CPQ Configurator answer storing the array of JSON objects.
-
In the HTML Content field, enter the JSON properties preceded by an asterisk and enclosed in curly braces. The syntax is {*property}.
-
-
If you selected QTable in step 2:
-
In the QTable Question field, enter the NetSuite CPQ Configurator qTable question code.
-
In the HTML Content field, enter the qTable lowercase answer code preceded by an asterisk and enclosed in curly braces. The syntax is {*answercode}.
-
-
Click Save.
For example, you want the document to include the list of all desk models belonging to the same series the user has selected. This information is already stored in JSON format in a NetSuite CPQ Configurator answer. You want to add that information to the HTML Content field to avoid manually typing in everything.
The array of JSON objects looks like this:
[
{
"series":"A1000",
"shape":"Rectangle",
"topfinish":"Wood"
},
{
"series":"A1000",
"shape":"Rectangle",
"topfinish":"Laminate"
},
{
"series":"A1000",
"shape":"L-shape",
"topfinish":"Wood"
},
{
"series":"A1000",
"shape":"L-shape",
"topfinish":"Laminate"
},
{
"series":"A1000",
"shape":"U-shape",
"topfinish":"Wood"
}
]
-
In the JSON Q/A field, enter the combination of question and answer codes, for example, DESK_A1000/MODELS.
-
In the HTML Content field, specify the properties you want to extract from the array.
Enter the properties preceded by an asterisk and enclosed in curly braces.
Series: {*series} | Shape: {*shape} | Top Finish: {*topfinish}
In the final document, the result would be:
Series: A1000 | Shape: Rectangle | Top Finish: Wood
Series: A1000 | Shape: Rectangle | Top Finish: Laminate
Series: A1000 | Shape: L-shape | Top Finish: Wood
Series: A1000 | Shape: L-shape | Top Finish: Laminate
Series: A1000 | Shape: U-shape | Top Finish: Wood
Including Dynamic Information from Transactions and Your Account
In your documents, you can include information from transactions and your account by using placeholders. The following table shows the available placeholders and the data type they represent.
Placeholder |
Description |
---|---|
|
Represent a transaction body field, a transaction line field, or an item record body field, respectively. Use the field ID. Depending on the field type, return:
Item body fields for configured items correspond to those of the base item. |
{$storedisplayimage} |
Returns the item image from the Item Display Image field. This field is placed under the Web Store subtab on the item record. |
{$GROUPNAME} |
Returns the name of the grouping to which the item belongs. The group name corresponds to the value taken by the field specified in the Group Items By field on the parent group. |
{$GROUPTOTAL} |
Returns the total amount for the items belonging to the same grouping. The group depends on the value taken by the field specified in the Group Items By field on the parent group. |
{$date} |
Returns the current date in the DD/MM/YYYY format. |
|
Return the page number and the total number of pages, respectively. |
The following table describes the options to select in groups and sections to work with each placeholder.
Placeholder |
Repeat Field (Group Record) |
Run For Field (Section Record) |
---|---|---|
|
Once |
— |
Every Item |
|
|
Every Config |
— |
|
|
Every Item |
|
|
Every Item |
|
Some placeholders can be extended by adding parameters. The following table lists the available parameters for each placeholder.
Placeholder Parameter |
Description |
Compatible Placeholders |
---|---|---|
:text |
Returns the option or options for dropdown lists and multiple-choice fields instead of the option ID. If users select multiple options, they are returned separated by commas. |
|
$currency |
Formats numbers into currency. The field must contain numbers. |
|
Parameters are appended to placeholders. See the following examples:
-
{@TransactionBodyFieldID:text}
-
{$GROUPTOTAL$currency}