Search or browse our knowledge base to find answers to your questions ranging from account questions to troubleshooting error messages. The content is curated and updated by our global Support team
Qlik Application Automation has a "Call URL" block that allows you to call a URL when the automation needs data from a URL or when it needs to send data to a URL. This article explains how this block can be used to run a Qlik AutoML prediction right from the Qlik Application Automation.
The Call URL block calls a URL, typically from an API.
Ex: https://{enter_your_automl_env_here}/api/v1/automl/graphql
Ex: ML Deployment Url:
https://{automl_environment_url}/automl/deployed-model/5048076e-bea6-xxxx-b79e-a8a45b316b08
Deployment Id: 5048076e-xxxx-43fa-b79e-a8a45b316b08
Step 1(List Predictions): First we need to call the API to list the prediction datasets from a deployed model. For this, we need to add proper ‘query” and “variable” params in the call URL block.
You can use the ‘Raw Input’ option to enter these parameters.
IMP Note: Your ML Deployment model must have at least one dataset prediction to run.
Please copy the following JSON and replace the deploymentId with your deploymentId you got from ML Deployment Url and paste it into the automation after triggering the raw input option of ‘Params’.
{
"query": "query Predictions($filter: PredictionFilter) {\r\n predictions(filter: $filter) { total rows { id } }}",
"variables": {
"filter": {
"deploymentId": "5048076e-xxxx-43fa-xxxx-a8a45b316b08"
}
}}
Output from this Call Url block will contain the list of Ids of Prediction datasets from your selected ML Deployment.
Step 2(Run Prediction): Now we need to call the RunPrediction API with the prediction dataset Id we obtained in the previous step as the input. For this, we need to add proper ‘query” and “variable” params in the call URL block.
You can use the ‘Raw Input’ option to enter these params
Please copy the following JSON and replace the predictionID with the predictionID you got in the output in the previous step and paste it into the automation after triggering the raw input option of ‘Params’.
{
"query": "mutation RunPrediction($predictionId: String!) { runPrediction(predictionId: $predictionId) { info { id status } }}",
"variables": {
"predictionId": "c1bdbd62-xxxx-40e0-xxxx-b10c5bd7d350"
}
}
Running this will run the Prediction dataset whose Id you provided.
We have attached an example template showcasing the above automation as a JSON file. You can upload(import) this file into your application automation.
You can find the process to import the file into automation here: How-to-import-and-export-automations
The information in this article is provided as-is and will be used at your discretion. Depending on the tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.