How to start tasks within a reload script in Qlik Sense using a REST connection?

How to start tasks within a reload script in Qlik Sense using a REST connection?

FIRST CREATED ON 1 Jun 2023  I  AUTHOR Emma Camacho

Starting tasks within a reload script in Qlik Sense using a REST connection allows you to automate processes and enhance workflow efficiency. Here’s how you can set it up.

1) First configure a REST connection:

Configure REST Connection to connect to M&D from Qlik Sense


2a) API Call to a Task that does not have parameters


//API-call without parameters

LIB CONNECT TO 'ExecuteM&DTask_02SendReportbyEmail';

RestTable:

SQL SELECT

FROM JSON (wrap on) "Root";

Drop Table RestTable;


2b) API Call to a Task that has parameters




//API-call with parameters using URL

LIB CONNECT TO 'ExecuteM&DTask_03SendReportbyEmailwithParameters'; 

Let vBrand= 'Audi'; 

Let vCountry= 'Austria'; 

RestTable: 

SQL SELECT 

FROM JSON (wrap on) "Root"  

WITH CONNECTION ( 

Url "https://company .mail-and-deploy.com/Api?Method=ExecuteTaskAsync&TaskId=d0077050-92bb-4f33-ba91-cbf4f4e33d30&Delay=5&Parameters=Brand:$(vBrand)|Country:$(vCountry)" 

); 

Drop Table RestTable; 

 

//API-call with parameters using QUERY 

LIB CONNECT TO 'ExecuteM&DTask_03SendReportbyEmailwithParameters'; 

Let vBrand= 'Mazda'; 

Let vCountry= 'Italy'; 

RestTable: 

SQL SELECT 

FROM JSON (wrap on) "Root"  

WITH CONNECTION ( 

QUERY "Parameters" "Brand:$(vBrand)|Country:$(vCountry)"); 

Drop Table RestTable; 



Looking for Additional Guidance?


If you require more detailed information or further assistance, please visit our comprehensive Online Documentation. Our resources are designed to help you navigate all features and functionalities effectively.


    • Related Articles

    • How can I start tasks using Curl.exe?

      FIRST CREATED ON 1 Jun 2023 I AUTHOR Emma Camacho Starting tasks using Curl.exe provides a simple and flexible way to automate actions via the command line. Here's a quick guide on how to initiate tasks with Curl.exe. To start a Task using CURL.EXE, ...
    • How to configure a REST connection to link Mail & Deploy with Qlik Sense?

      FIRST CREATED ON 30 May 2023 I AUTHOR Emma Camacho Configuring a REST connection to link Mail & Deploy with Qlik Sense allows seamless data integration and interaction between the two platforms. Here’s a brief guide to set up the connection. 1. ...