The Picklist Extension Pricing enrichment
Summarize
Summary of The Picklist Extension Pricing enrichment
The Picklist Extension Pricing enrichment in ServiceNow CPQ enables dynamic adjustment of pricing for picklist extension fields based on factors such as geographic location or other business rules. This feature allows pricing of field options within designated picklist extensions to be modified programmatically during the configuration process.
Show less
Prerequisites
- A support case must be submitted to ServiceNow to enable this enrichment in your environment, including a use case description.
- Picklist extension fields must have the "Enable for enrichment" toggle activated to be affected.
- The enrichment can be managed and viewed in the enrichments tab within the CPQ Admin blueprint interface.
Key Features
- Dynamic Pricing Adjustments: Modify prices of picklist options at runtime based on configurable logic such as ZIP code pricing.
- Script-Based Customization: Use JavaScript to loop through selected picklist options, perform lookups to pricing tables, and apply factors or multipliers to determine final prices.
- Support for Complex Pricing Scenarios: Enables ZIP code dependent pricing, price multipliers, discounts, delta pricing, and independent component pricing.
- pleRequest Object: Provides access to picklist variables, option values, product IDs, and prices for scripting, facilitating detailed customization.
How It Works
The enrichment processes the pleRequest array containing picklist selections. Scripts can:
- Collect selected options by field variable names.
- Query pricing data from custom tables based on criteria such as ZIP code.
- Apply multipliers or discounts to base prices.
- Update the price property on each picklist option dynamically.
Practical Benefits for ServiceNow Customers
- Enables tailored pricing strategies that reflect regional variations or complex product configurations.
- Improves pricing accuracy and flexibility within the CPQ process without manual overrides.
- Supports advanced pricing models that can boost sales effectiveness and customer satisfaction.
- Integrates seamlessly with existing CPQ blueprints and product configurations through scripting.
Next Steps
- Submit a support case to enable the enrichment with a clear use case.
- Configure picklist extension fields to enable enrichment.
- Develop or customize scripts based on your pricing logic using the provided scripting patterns and example demonstration.
- Test pricing changes in your CPQ environment to validate dynamic pricing behavior.
Use the Picklist Extension Pricing enrichment to adjust pricing according to location or other factors.
The Picklist Extension Pricing enrichment can be used to dynamically change the pricing of Field Options in designated picklist extension fields.
Prerequisites
Submit a support case requesting the enrichment be enabled for your environment. Please provide a use case for using the enrichment. To submit a support case, use the ServiceNow Support portal. For step-by-step instructions, see Create a case on Now Support for CPQ Customers.
Picklist extension fields need to have the "Enable for enrichment" toggle turned on to be affected by the enrichment.
The enrichments tab will be shown when navigating to a blueprint in the CPQ Admin.
Watch this demonstration of the Picklist Extension Pricing enrichment in action.
Demonstration script
The following script was used in the demonstration video.
let sourcesArr = [];
let componentArr = [];
let accessoryArr = [];
pleRequest.forEach(o => {
if(o.fieldVariableName == "alternateEnergySources") {
sourcesArr.push(o.optionValue);
//o.price = "1000";
}
if(o.fieldVariableName == "alternateEnergyComponents") {
componentArr.push(o.optionValue);
//o.price = "900";
}
if(o.fieldVariableName == "alternateEnergyAccessory") {
accessoryArr.push(o.optionValue);
//o.price = "800";
}
});
var sourceMap = new Map();
if(sourcesArr != null && sourcesArr.length != 0) {
var sourceRows = lookup("Select Energy, BasePrice from AlternateEnergyPricing where Zip = :zip and Energy IN (:value)", { "zip": cfg.zipCode, "value": sourcesArr });
for (var row of sourceRows) {
sourceMap.set(row.get("Energy"), row.get("BasePrice"));
}
} else { //source PLE not part of request. So populate this map for other PLEs
console.log("Entered non PLE in request case");
sourcesArr = ["Solar", "Wind", "Nuclear"];
var sourceRows = lookup("Select Energy, BasePrice from AlternateEnergyPricing where Zip = :zip and Energy IN (:value)", { "zip": cfg.zipCode, "value": sourcesArr });
for (var row of sourceRows) {
sourceMap.set(row.get("Energy"), row.get("BasePrice"));
}
console.log(sourcesArr);
console.log(sourceMap);
}
var multiplierMap = new Map();
if(cfg.alternateEnergySources != "") {
var multiplierRows = lookup("Select Group, Factor from AlternateEnergyMultiplier where Zip = :zip and Energy = :energyVal", { "zip": cfg.zipCode, "energyVal": cfg.alternateEnergySources });
for (var row of multiplierRows) {
multiplierMap.set(row.get("Group"), row.get("Factor"));
}
}
let sourcePrice = sourceMap.get(cfg.alternateEnergySources);
if(sourcePrice != null) {
pleRequest.forEach(o => {
if(o.fieldVariableName == "alternateEnergySources") {
o.price = sourceMap.get(o.optionValue);
}
if(o.fieldVariableName == "alternateEnergyComponents") {
let compPrice = multiplierMap.get("Component");
if(compPrice != null) {
o.price = sourcePrice*compPrice;
}
}
if(o.fieldVariableName == "alternateEnergyAccessory") {
let multA = multiplierMap.get("Accessory");
if(multA != null) {
o.price = sourcePrice*multA;
}
}
});
}
console.log(sourcesArr);
console.log(componentArr);
console.log(accessoryArr);
console.log(sourceMap);
console.log(multiplierMap);
return pleRequest;
Sample design, use cases, and pleRequest elements
Sample enrichment script design:
- Loop through picklist options and store them for reference later (pleRequest.forEach())
- Get prices for options and store them (either via table lookup or in the function itself)
- Set the price for the right option (pleRequest.forEach())
Use cases:
- ZIP code dependent pricing
- Price multipliers and discounts
- Delta pricing
- Independent component pricing subtraction
pleRequest elements:
- pleRequest.fieldVariableName: variable name of the picklist field
- pleRequest.optionValue: picklist options defined in the field
- pleRequest.productId: ID of the product in the PLE mapping
- pleRequest.price: price to be set in the extension
Referencing elements in the pleRequest object is similar to referencing objects such as ProductList, cfg, and cfgRequest. If a variable is substituted into
pleRequest (either in a for loop or using the forEach function), the element is still referenced after the variable, followed by a period.