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. 

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.