1 Reply Latest reply: Jan 16, 2018 8:23 AM by Carl Hunter RSS

    REST Connector - WITH CONNECTION Syntax

    Carl Hunter

      Hi All

       

      Can anyone point me in the direction for syntax or usage guidelines for the WITH CONNECTION keyword of the REST SQL command?

       

      I am wanting to override the Query Parameters i.e. iterate through a list of IDs, firing the GET command for each iteration, and the Query Headers i.e. changing the Authorization and Bearer Tokens at run time.

       

      I've found a few forum posts, but, I can't see any technical guidelines.

       

      The Qlik Online Help talks about the "WITH CONNECTION" keyword which is what I believe I need to use, but, doesn't go into the detail of what it can do (see here > https://help.qlik.com/en-US/connectors/Subsystems/REST_connector_help/Content/1.2/Load-REST-data/Select-statement-syntax-REST.htm)

       

      Any assistance greatly appreciated !

       

      Cheers

      Carl.

        • Re: REST Connector - WITH CONNECTION Syntax
          Carl Hunter

          I think I've figured out that if I use the QUERY attribute of WITH CONNECTION, I am able to override the values set in the Data Connection... as per below...

           

          RestConnectorMasterTable:

          SQL SELECT

          "Column1",

          "Column2",

          "Column3"

          FROM JSON (wrap on) "root" PK "__KEY_root"

          WITH CONNECTION

          (

               QUERY "Authorization"     "$(vBearerToken)",

               QUERY "ApiKey "           "$(vApiKey)",

               QUERY "startDate"         "$(vReportStartDate)",

               QUERY "endDate"           "$(vReportEndDate)"

          );