Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Get Product Details

Learning Objectives

After completing this unit, you’ll be able to:

  • Explain how to retrieve products that meet a specified criteria.
  • List the steps to get detailed product information, including calculated pricing.
  • Describe how to recalculate product pricing based on user customizations.

Retrieve Product Information and Pricing

Retrieving information about products is a crucial part of quoting OmniScript. The OmniScript must identify and retrieve relevant product information that meets the user’s requirements. After the information is retrieved, the user can decide which product to select and proceed with quote creation.

Here are three important services for retrieving, rating, and repricing products.

  • InsProductService:getEligibleProducts: This service returns a list of products that match a specified criteria.
  • InsProductService:getRatedProducts: This service returns products and their rates.
  • InsProductService:repriceProduct: This service rerates a product as it is customized.

Here’s a detailed look at these services.

Get Eligible Products

When building a quoting experience, it is crucial to only present eligible products to the user. This ensures that the quote is valid and accurate. To achieve this, use the getEligibleProducts service, which retrieves only the products that meet certain criteria. These criteria include filters such as effective date and product eligibility rules.

For instance, filter for products that require the user to be over the age of 65. The service returns a list of product IDs that match your criteria.

Multiple products filtered down to three Product IDs.

For more details about this service and its available options, check out InsProductService:GetEligibleProducts.

Return Products with Pricing

To show product details and pricing information for the user, you need more than just a product ID. You want the whole product JSON with all of the product details along with rating calculation results. Enter getRatedProducts. Use this service to get detailed product information plus pricing.

Multiple products filtered down to product JSONs with pricing.

In some ways, getRatedProduct is similar to getEligibleProducts. It returns only products that match your specified criteria based on effective date, product eligibility rules, and filters. However, there are a few key differences. The getRatedProduct service:

  • Runs other rules such as optional coverage rules. You run rules starting from the top to set coverages correctly, such as whether they are selected by default.
  • Returns product JSON objects with details including child products and attributes. The product specs are the templates for constructing the product JSON.
  • Takes requirements for rating as input. The service calls the rating procedure and adds rating results to the product JSON.

Here are sample snippets of input JSON and output JSON forgetRatedProducts.

The input JSON with node userInputs and output JSON including a Price key.

How do you know that the input JSON meets the requirements for rating? Use the root product’s API tab and choose getRatedProducts. It tells you the input required, which is generally child spec attributes. Copy the JSON value of the input from there to a Data Mapper’s Expected JSON pane to prepare the input.

The output JSON includes CalculatedPriceData, RawPriceData, Root Product level information, and information on the childProducts. Attributes are organized by category, and each attribute has a userValues key populated based on the user spec but updated if the user makes changes. If there are any attribute or attribute value rules, they are included in the JSON for the user interface to run. The product JSON changes as the user walks through the process until it’s sent to create the quote.

For more details about this service and its available options, check out InsProductService:GetRatedProducts.

Reprice the Product

When a user customizes a product, the repriceProduct service recalculates the price. The service takes a product JSON as input and returns it with the updated pricing.

The Product JSON with a new price tag is a sum of the coverages customized on product JSON and repriceProduct.

For more details about this important service, check out InsProductService:repriceProduct.

You’ve learned about several great services for retrieving desired product information. Now, how do you show that data in a clean and easy-to-use interface for the user? That’s up next, so head on over to the next unit.

Resources

Compartilhe seu feedback do Trailhead usando a Ajuda do Salesforce.

Queremos saber sobre sua experiência com o Trailhead. Agora você pode acessar o novo formulário de feedback, a qualquer momento, no site Ajuda do Salesforce.

Saiba mais Continue compartilhando feedback