--- title: "Search for product variants" slug: "search-for-product-variants" description: "View and reuse variants of a selected configurable product in Zilliant CPQ through a Groovy script, through API, or from the product configurator." updated: 2025-02-04T11:13:15Z published: 2025-02-04T11:13:15Z canonical: "docs.zilliant.com/search-for-product-variants" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.zilliant.com/llms.txt > Use this file to discover all available pages before exploring further. # Search for product variants Due to the complexity of product manufacturing, numerous product variants are created over time. To streamline work with products, Zilliant CPQ allows you to view and reuse variants of a selected configurable product in three ways: - [From the product configurator in a quote](/v1/docs/search-for-product-variants#from-the-product-configurator-in-a-quote) - [Through Product Finder API](/v1/docs/search-for-product-variants#through-product-finder-api) - [Through a Groovy script](/v1/docs/search-for-product-variants#through-a-groovy-script) ## From the product configurator in a quote From the product configurator in quotes, Zilliant CPQ allows you to view and reuse variants of a configurable product that you want to add to a quote. To learn more about managing product variants from the product configurator, read [Manage product variants](/docs/manage-product-variants). ## Through Product Finder API With Product Finder API, Zilliant CPQ users can search for variants of a specific product without the need to create a quote in the application. To learn more, read [Product Finder API](https://documenter.getpostman.com/view/8744824/T1DsAbVE#64bdb53b-587f-496b-94c5-d1dc2e2d1180) ![](https://cdn.document360.io/24f960e8-3c1c-4c18-a2c6-83b6ae4aab84/Images/Documentation/external-link-svgrepo-com.svg?sv=2026-02-06&spr=https&st=2026-11-10T17%3A05%3A09Z&se=2026-11-10T18%3A05%3A09Z&sr=c&sp=r&sig=aDnJykXVHl4TM8rSUwAVwSHQnQvCIC0QlIEqZmmLDxk%3D). ## Through a Groovy script By running a Groovy script, Zilliant CPQ users can search for variants of a specific product without the need to create a quote in the application. To search for product variants through a Groovy script, follow these steps: 1. [Create a Groovy script](/docs/search-for-product-variants#create-a-groovy-script). 2. [Upload the Groovy script to Zilliant CPQ](/docs/search-for-product-variants#upload-a-groovy-script). ### Create a Groovy script Create a Groovy script that lists all characteristics that variants of the specified product must have. This script supports the [common binding variables](/docs/binding-variables) and must call the following method: | Method | Class | Description | | --- | --- | --- | | findProductFinder | [GroovyCtxUtil](https://in-mind-cloud.github.io/content/groovy-doc/2408/com/imc/iss/groovy/GroovyCtxUtil.html) ![](https://cdn.document360.io/24f960e8-3c1c-4c18-a2c6-83b6ae4aab84/Images/Documentation/external-link-svgrepo-com.svg?sv=2026-02-06&spr=https&st=2026-11-10T17%3A05%3A09Z&se=2026-11-10T18%3A05%3A09Z&sr=c&sp=r&sig=aDnJykXVHl4TM8rSUwAVwSHQnQvCIC0QlIEqZmmLDxk%3D) | Searches for product variants that match provided characteristics. | **Example Groovy script with comments** ```groovy // Import necessary classes and libraries import com.imc.vocabulary.Schema; import com.imc.datamodel.BusinessObject import java.util.List; import com.imc.iss.web.resource.Resource import java.util.Map; import com.imc.iss.groovy.GroovyLogger import com.google.common.collect.Maps; import java.util.ArrayList; import com.google.common.collect.Sets; groovyLogger.notifyInfo("Welcome"); BusinessObject productBO = BusinessObject.create("/Product#ID"); // List characteristics that product variants must match List resource =  new ArrayList<>(); Resource resource1 = new Resource() resource1.put("type" , "DynamicDataAttribute") resource1.put("uri", "/DynamicDataAttribute#Body_Color") resource1.put("value","Blue") resource1.put("hasDataType", "/application/schema.owl#StringType") resource.add(resource1); Resource resource2 = new Resource() resource2.put("type" , "DynamicDataAttribute") resource2.put("uri", "/DynamicDataAttribute#Engine_Displacement") resource2.put("value",1500) resource2.put("hasDataType", "/application/schema.owl#NumericType") resource.add(resource2); Resource resource3 = new Resource() resource3.put("type" , "DynamicDataAttribute") resource3.put("uri", "/DynamicDataAttribute#IsElectricVarient") resource3.put("value", true) resource3.put("hasDataType", "/application/schema.owl#BooleanType") resource.add(resource3); Resource[] resourceArray = new Resource[resource.size()]; resource.toArray(resourceArray); groovyLogger.notifyInfo("Calling findProductFinder method with productBO: {}" + productBO.getUriAsString());   // Call the findProductFinder method to get matching product variants Collection products = groovyCtxUtil.findProductFinder(productBO, resourceArray); for(BusinessObject product : products) {    groovyLogger.notifyInfo("Product URI: " + product.getUriAsString()); } return salesItemsTree; ``` ### Upload a Groovy script [Upload the Groovy script](/docs/upload-a-groovy-script) to Zilliant CPQ. At Step 5, select any of the existing Groovy exits to edit it. Then, in the **Script File** field, select your Groovy script file to upload.