---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# MLSolutionFactory - Global

# MLSolutionFactory - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The MLSolutionFactory API is a factory class to get an MLSolution
scriptable object.

This API requires the Predictive Intelligence plugin (com.glide.platform_ml) and is provided within the `sn_ml` namespace. For more information, see [Predictive Intelligence](https://www.servicenow.com/docs/access?context=predictive-intelligence&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US).

For usage guidelines, refer to [MLSolutionFactory scriptable
objects](https://www.servicenow.com/docs/access?context=using-ml-apis-mlsolutionfactory&version=xanadu&pubname=xanadu-intelligent-experiences&ft:locale=en-US).
**Related concepts**   

* [MLSolution](https://servicenow-prod.fluidtopics.net/T3s5VejYlP~j3rbn2wZ4JQ#MLSolutionAPI "The MLSolution API provides methods for handling Predictive Intelligence predictions and retrieving solution objects for all capabilities: similarity, classification, and clustering).")
* [MLSolutionUtil](https://servicenow-prod.fluidtopics.net/1cQ4_TaoEGg8FOCirG46RQ#MLSolutionUtilAPI "The MLSolutionUtil script include provides methods for getting Predictive Intelligence predictions.")
* [REST API: Get predictions for multiple solutions](https://servicenow-prod.fluidtopics.net/4_wEe9KV95LgGzRpMcfszA#agent-intelligence-api "The Predictive Intelligence API provides endpoints that predict a field value based on one or more input fields and a trained solution.")

## MLSolutionFactory - getSolution(String solutionName, Object options) {#ariaid-title2}

Gets an MLSolution object for a specified solution name.
{#MLSolutionFactory-getSolution_S_O__table_hqw_pbm_yfb__entry__3}

| Name | Type | Description |
|-|-|-|
| solutionName | String | Name of the solution. |
| options | Object | Optional. options.version: If provided, creates MLSolution instance for provided version of solutionName. |
[Table 1. Parameters]

{#MLSolutionFactory-getSolution_S_O__table_hqw_pbm_yfb} {#MLSolutionFactory-getSolution_S_O__table_iqw_pbm_yfb__entry__2}

| Type | Description |
|-|-|
| Object | [MLSolution](https://servicenow-prod.fluidtopics.net/T3s5VejYlP~j3rbn2wZ4JQ#MLSolutionAPI "The MLSolution API provides methods for handling Predictive Intelligence predictions and retrieving solution objects for all capabilities: similarity, classification, and clustering).") object of the specified solution. |
[Table 2. Returns]

{#MLSolutionFactory-getSolution_S_O__table_iqw_pbm_yfb}  

    // basic usage
    var mlSolution = sn_ml.MLSolutionFactory.getSolution("ml_incident_categorization");
            
    // using options.version parameter
    var options = {};
    options.version = 1;
    var mlSolution = sn_ml.MLSolutionFactory.getSolution("ml_incident_categorization", options);


