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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nkumarkanduri
Contributor II
Contributor II

With connection in Rest API connector

Hi ALL,

I am trying to get a key using POST request with Qualtrics API. I was successful when i ran it individually, but somehow when I put that in a loop using with connection while changing the url and request body, it is throwing an error:

"

The following error occurred:

Connector reply error: Unknown substring, string, or value at (16,58): '-05-01 22:31:20"}")'
 
Please find the code below:
 

For i=0 to NoOfRows('elements')-1
let vele1=peek('name',i,'elements');

table1:
load * from [Lib://QVD_Files_Public/System/QUALTRICS_RAW.qvd] (qvd) where [flag]='$(vele1)';

[temp1]:
load [RecordedDate] resident table1 Order By [RecordedDate];
let vele4=peek('RecordedDate',-1,'temp1');
drop table [temp1],table1;
let vreq='{"format":"csv","compress":"false","startDate":"$(vele4)"}';

LIB CONNECT TO 'QualtricsPost';
RestConnectorMasterTable:
SQL SELECT
"__KEY_root",
(SELECT
"progressId",
"percentComplete",
"status",
"__FK_result"
FROM "result" FK "__FK_result"),
(SELECT
"requestId",
"httpStatus",
"__FK_meta"
FROM "meta" FK "__FK_meta")
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION(Url "<url>"
BODY "$(vreq)");

[result]:
LOAD '$(vele1)' as [name],'$(vele)' as [id],[progressId],
[percentComplete],
[status],
[__FK_result] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_result]);


DROP TABLE RestConnectorMasterTable;
next i
drop Table [elements];
exit script;

 

clipboard_image_0.png
 
It would be great if someone can help me how to use with connection for changing the request body.
 
Thanks in Advance.
0 Replies