Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
dvillar3589
Contributor II
Contributor II

Having Trouble Writing REST API POST Call during Partial Reload

Hi everyone, I am hoping someone out there will have a solution to this!

My goal is to have my Qlik App run a REST API POST call  that triggers a databricks notebook with parameters but only after the user has clicked a button that triggers a partial reload(where I want to store the script that trigger sthe api post call).

I am working on an app in Qlik Sense and am trying to run a REST API POST call but ONLY on a Partial Load. I configured a REST connector called WIDGETS_POST that successfully connects to and sends string parameters to the databricks job.I also am able to run the call if the code is in the Main section of the Qlik Load Editor and I click "Load Data" manually. The code that works successfully but ONLY when in the Main Section is below: 

      LET vRequestBody = '{""job_id"":""12345"",
            ""notebook_params"": {
                  ""folderPath"":""Test1"",
                  ""color"": ""Test2"",
                  ""transport"":""Test3""}}';
 
      LIB CONNECT TO 'WIDGETS_POST (uot_12345)';
 
      RestConnectorMasterTable:
      SQL SELECT
            "run_id",
            "number_in_job"
      FROM JSON (wrap on) "root"
      WITH CONNECTION (
            URL "$(vURL)",
      HTTPHEADER "Authorization" "exampletoken12",
      HTTPHEADER "Content-Type" "application/json",
      BODY "$(vRequestBody)"
      );
 
[root]:
LOAD  [run_id],
      [number_in_job]
RESIDENT RestConnectorMasterTable;
 
 
DROP TABLE RestConnectorMasterTable;

 

I created a new section in my Qlik Load editor and called it "Partial Load" and i added the code :

If (IsPartialReload()) THEN

      LET vRequestBody = '{""job_id"":""12345"",
            ""notebook_params"": {
                  ""folderPath"":""Test1"",
                  ""color"": ""Test2"",
                  ""transport"":""Test3"}}';
 
      LIB CONNECT TO 'WIDGETS_POST (uot_12345)';
 
      RestConnectorMasterTable:
      SQL SELECT
            "run_id",
            "number_in_job"
      FROM JSON (wrap on) "root"
      WITH CONNECTION (
            URL "$(vURL)",
      HTTPHEADER "Authorization" "exampletoken12",
      HTTPHEADER "Content-Type" "application/json",
      BODY "$(vRequestBody)"
      );
 
[root]:
LOAD  [run_id],
      [number_in_job]
RESIDENT RestConnectorMasterTable;
 
 
DROP TABLE RestConnectorMasterTable;

END IF;

However every single time I click the button that triggers a partial reload, the parameters are not sent and the call is not made. I have seen some documentation about needing to use REPLACE or ADD in front of the Table name in your Partial Reload but it seems to be difficult to configure with the SQL SELECT statement.

 

ANY help at all would be GREATLY appreciated this has been driving me up the wall! My end goal is to have a user make some selections from a filter that gets saved into a variable and is passed through this api call but I cant seem to get the button to trigger the call at all.

 

Labels (4)
0 Replies