The On BOM Response enrichment

  • Release version: Australia
  • Updated March 12, 2026
  • 3 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of The On BOM Response enrichment

    The On BOM Response enrichment in ServiceNow CPQ allows customers to manipulate ProductList items whenever there is an update to the bill of materials (BOM). It is enabled by default and works by processing the BOM results generated by the rules engine during runtime. This enrichment enables dynamic updates to product pricing, attributes, or line items based on specific conditions or external data.

    Show full answer Show less

    How It Works

    • The enrichment operates on the ProductList returned by the rules engine BOM, preventing infinite loops by not referencing its own enriched BOM.
    • It can loop through ProductList items to apply logic such as adjusting prices or modifying attributes.
    • It supports calling external REST APIs via GET or POST to retrieve data (e.g., pricing rates) and apply these dynamically to the BOM products.
    • Changes made in the enrichment affect the BOM shown to users, but conditions may re-trigger on subsequent BOM updates because the enriched BOM is not reused as input.

    Practical Uses

    • Dynamically changing product prices—either static changes like a fixed shipping fee or dynamic changes based on customer-specific data such as tax rates or usage fees.
    • Modifying product attributes conditionally, for example, adjusting quantities of promotional items when certain thresholds are met within the BOM.
    • Removing line items from the BOM based on specified business rules.

    Key Considerations

    • The CPQ environment must have rules with product actions for the enrichment to process any ProductList items.
    • When external data is used, consistency in responses is important to avoid unexpected repeated changes on BOM updates.
    • Because the enrichment references the rules engine BOM rather than the enriched BOM, changes may reapply each time the BOM is updated if not designed carefully.

    What Customers Can Expect

    ServiceNow customers can leverage the On BOM Response enrichment to enhance their BOM processing with customized pricing and product logic that responds dynamically to internal conditions or external data sources. This flexibility helps ensure BOMs are accurate, reflect current business rules, and can integrate real-time data for pricing or product adjustments, improving quoting accuracy and customer satisfaction.

    You can use this enrichment to work with ProductList items whenever there is an update to the bill of materials.

    The On BOM Response enrichment is enabled by default in environments and can be used to manipulate items in the ProductList whenever there is an update to the bill of materials (BOM).

    Note:
    The CPQ environment must include rules with product actions, or there will be nothing for the enrichment to loop through.

    BOM response

    In the following sample, the On BOM Response enrichment loops through products and changes the price of a product.

    //Loop over products and change price of a product
    let dealProduct = cfg.blueMoonSelected;
    if (dealProduct == true) {
            for(var prod of ProductList) {
                    let price = prod.price * .8;
                    prod.price = price;
            }
    }

    On BOM Response enrichments may request external REST services via GET or POST.

    In the following sample script, the On BOM Response enrichment uses an external connection to query a powerPricing API with customer data. With the customer-specific rate data retrieved from the service, the enrichment adjusts the pricing of existing ProductList records.

    var powerInputs = {"membershipCode":cfg.eCMembershipCode, "icp":cfg.eCICPNumber};
    let powerResponse = External.powerPricing(powerInputs);
    let dailyCharge = 0; let ratesArr = [];
    
    if(powerResponse.status == 200) {
    	for(var record of powerResponse.body) {
    		if(record.chargeType == cfg.expectedUsage) {
    			dailyCharge = record.dailyCharges;
    			ratesArr = record.rates;
    		}
    	}
    	for(var prod of ProductList) {
    		if(prod.id=="electricBillEstimator") {
    			let addedPrice = dailyCharge * cfg.serviceDurationInDays;
    			prod.price = addedPrice;
    		}
    			if(prod.id=="Standard Rate" || prod.id=="Low Rate") {
    			prod.price = dailyCharge;
    		}
    	}
    	for(var rateVal of ratesArr) {
    		ProductList.id = "Additional Charge Per KWH: " + rateVal.name;
    		ProductList.quantity = 1;
    		ProductList.bomType = "Manufacturing";
    		ProductList.orderNumber = 2;
    		ProductList.price = rateVal.rate;
    		ProductList.notes = rateVal.measure;
    		ProductList.parentProduct = "electricBillEstimator";
    		ProductList.next();
    	}
    }
    
    return ProductList;

    The difference between the rules engine BOM and the enriched BOM

    There are two versions of the BOM during runtime: the rules engine BOM, which is based on the results of product rules during runtime, and the enriched BOM, which is the result of the BOM enrichment.

    The BOM enrichment's ProductList object (referenced in the script) is the result of the rules engine BOM, not the enriched BOM. This is to make sure there are no infinite loops. Suppose that the script were to reference its own ProductList that it returns, and the script were set up to increase the price of certain objects by a percentage on BOM update. In this case, the next time the contents of the BOM were updated, the price increase would happen again and again.

    To prevent this situation, the enriched BOM is not referenced by any rule or enrichment other than the validation enrichment's ProductList. While this makes sure that the BOM enrichment can function outside the rules engine, it also means that if a condition is met in the BOM enrichment, those conditions can be met again the next time the BOM is updated, because any change to the BOM in the BOM enrichment script that stops that condition will not be referenced.

    With external connections, this is not a problem as long as the response is consistent. However, if the response changes when fired multiple times, such as when generating a string or saving a certain time, it will update each time the BOM is updated.

    The BOM Response enrichment might be used to:

    • dynamically change the price of products in the BOM. This can be either a static or dynamic change rate, such as a shipping fee being static and taxes being dynamic.
    • change attributes of products in the BOM that are reliant on some condition in the BOM, such as the quantity of free stickers given out once $100+ of tax has been quoted.
    • remove a line item from the BOM.