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

Modified on Fri, 30 Aug at 2:08 PM

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.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article