Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
phillgilchrist
Contributor II
Contributor II

PULL FROM QRS API USING WITH CONNECTION

Hi...
 
Trying to pull from QRS API using WITH CONNECTION call as below...
When doing the reload, it pulls the expected number of rows, but not pulling the dimensions as expected.
So KEY shows 1-368 but id & createdDate are null...
 
Any pointers greatfully received.
 
RestConnectorMasterTable:
SQL SELECT
 "__KEY_root",
 (SELECT
  "id",
  "createdDate",
        "type",
        "connectionstring",
  "__FK_items"
 FROM "items" FK "__FK_items")
FROM JSON (wrap off) "root" PK "__KEY_root"
WITH CONNECTION(
URL "https://QLIKSERVER/qrs/dataconnection",
HTTPHEADER "X-Qlik-xrfkey" "12345678qwertyui",
QUERY "xrfkey" "12345678qwertyui"
);
;
Labels (1)
  • API

1 Reply
Levi_Turner
Employee
Employee

GET /qrs/dataconnnection does not have the createDate element but GET /qrs/dataconnection/full does.

Example script:

Let vDataConnection = 'monitor_apps_REST_app';

LIB CONNECT TO '$(vDataConnection)';

RestConnectorMasterTable:
SQL SELECT 
	"id" AS "id_u2",
	"createdDate" AS "createdDate_u0",
	"connectionstring",
	"type",
	"__KEY_root"
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION(
	URL "https://localhost/qrs/dataconnection/full",
	HTTPHEADER "X-Qlik-xrfkey" "12345678qwertyui",
	QUERY "xrfkey" "12345678qwertyui"
);

[dataconnections]:
LOAD	[id_u2] AS [id],
	[createdDate_u0] AS [createddate],
	[connectionstring],
	[type],
	[__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY_root]);

DROP TABLE RestConnectorMasterTable;