- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2023 09:48 PM
Hi
I tried to run Predictions on client side and was successfull following below article
But i observed its not populating prediction results table to view in reports
Any possible way to populate the table prediction results using client side predictions
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 06:57 AM
@Liyakhat
You should use the applyPrediction method to populate the Prediction Results table. Here is an example -
var mlSolution = sn_ml.MLSolutionFactory.getSolution("ml_incident_categorization");
var inputGR = new GlideRecord("incident");
inputGR.get("0ef47232db801300864adfea5e961912");
mlSolution.applyPrediction(inputGR);
Regards,
Brian

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 06:57 AM
@Liyakhat
You should use the applyPrediction method to populate the Prediction Results table. Here is an example -
var mlSolution = sn_ml.MLSolutionFactory.getSolution("ml_incident_categorization");
var inputGR = new GlideRecord("incident");
inputGR.get("0ef47232db801300864adfea5e961912");
mlSolution.applyPrediction(inputGR);
Regards,
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 07:07 AM
Thanks @Brian Bakker
This shall be in the script include predictcustomutils ? from below article
inputGR.get("0ef47232db801300864adfea5e961912");
here the sysid is of?
Thanks for your response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 07:15 AM
Thanks @Brian Bakker
The above code shall be placed in scriptinclude which is called from client side?
inputGR.get("0ef47232db801300864adfea5e961912");
can you help me with the sysId here related to?
Thanks for responding:)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 10:24 AM
If making predictions via a Script Include via the Client Side, I am assuming that the record already exists where you want to trigger the prediction on. The line for the prediction in the script include predictcustomutils is as follows -
var results = mlSolution.getVersion(version).predict(input, options);
I think you replace the method as follows -
var results = mlSolution.applyPrediction(input, options);
OR
var results = mlSolution.getVersion(version).applyPrediction(input, options);
This should apply the prediction and add the entry in [ml_predictor_results] table.
Regards,
Brian