Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
ChannaK
Contributor III
Contributor III

Pagination Next URL Not working

i have dat like below in postman request

ChannaK_0-1715155076241.png

 

in qlik connection i am using nextUrl as my pagination 

Next Url path :paging/link

it bring only one page can you help here

 

Labels (1)
1 Solution

Accepted Solutions
Levi_Turner
Employee
Employee

Because your pagination parameter is incorrect. To use an example API which returns subsequent pages in a URL in the response: https://rickandmortyapi.com/api/character

Levi_Turner_1-1715180930620.png

 

My next url path is root/info/next. Root is an artifact of how the Qlik REST connector works, you need to specify it. From there you need to provide the path in the JSON response to the URL. In this example it's info > next so I use root/info/next

Example Load Script:

LIB CONNECT TO 'REST_httpsrickandmortyapi.comapicharacter';

RestConnectorMasterTable:
SQL SELECT 
	"__KEY_root",
	(SELECT 
		"count",
		"pages",
		"next",
		"prev",
		"__FK_info"
	FROM "info" FK "__FK_info"),
	(SELECT 
		"id",
		"name" AS "name_u1",
		"status",
		"species",
		"type",
		"gender",
		"image",
		"url" AS "url_u1",
		"created",
		"__KEY_results",
		"__FK_results",
		(SELECT 
			"name",
			"url",
			"__FK_origin"
		FROM "origin" FK "__FK_origin"),
		(SELECT 
			"name" AS "name_u0",
			"url" AS "url_u0",
			"__FK_location"
		FROM "location" FK "__FK_location"),
		(SELECT 
			"@Value",
			"__FK_episode"
		FROM "episode" FK "__FK_episode" ArrayValueAlias "@Value")
	FROM "results" PK "__KEY_results" FK "__FK_results")
FROM JSON (wrap on) "root" PK "__KEY_root";

[info]:
LOAD	[count],
	[pages],
	[next],
	[prev],
	[__FK_info] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_info]);


[origin]:
LOAD	[name],
	[url],
	[__FK_origin] AS [__KEY_results]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_origin]);


[location]:
LOAD	[name_u0] AS [name_u0],
	[url_u0] AS [url_u0],
	[__FK_location] AS [__KEY_results]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_location]);


[episode]:
LOAD	[@Value],
	[__FK_episode] AS [__KEY_results]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_episode]);


[results]:
LOAD	[id],
	[name_u1] AS [name_u1],
	[status],
	[species],
	[type],
	[gender],
	[image],
	[url_u1] AS [url_u1],
	[created],
	[__KEY_results],
	[__FK_results] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_results]);


[root]:
LOAD	[__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY_root]);


DROP TABLE RestConnectorMasterTable;

Back to your example, I would expect the next URL parameter to be root/paging/next/link.

View solution in original post

3 Replies
Levi_Turner
Employee
Employee

I would expect root/paging/next/link to work.

ChannaK
Contributor III
Contributor III
Author

i see it is not loading all it is not fetching n ext link

Levi_Turner
Employee
Employee

Because your pagination parameter is incorrect. To use an example API which returns subsequent pages in a URL in the response: https://rickandmortyapi.com/api/character

Levi_Turner_1-1715180930620.png

 

My next url path is root/info/next. Root is an artifact of how the Qlik REST connector works, you need to specify it. From there you need to provide the path in the JSON response to the URL. In this example it's info > next so I use root/info/next

Example Load Script:

LIB CONNECT TO 'REST_httpsrickandmortyapi.comapicharacter';

RestConnectorMasterTable:
SQL SELECT 
	"__KEY_root",
	(SELECT 
		"count",
		"pages",
		"next",
		"prev",
		"__FK_info"
	FROM "info" FK "__FK_info"),
	(SELECT 
		"id",
		"name" AS "name_u1",
		"status",
		"species",
		"type",
		"gender",
		"image",
		"url" AS "url_u1",
		"created",
		"__KEY_results",
		"__FK_results",
		(SELECT 
			"name",
			"url",
			"__FK_origin"
		FROM "origin" FK "__FK_origin"),
		(SELECT 
			"name" AS "name_u0",
			"url" AS "url_u0",
			"__FK_location"
		FROM "location" FK "__FK_location"),
		(SELECT 
			"@Value",
			"__FK_episode"
		FROM "episode" FK "__FK_episode" ArrayValueAlias "@Value")
	FROM "results" PK "__KEY_results" FK "__FK_results")
FROM JSON (wrap on) "root" PK "__KEY_root";

[info]:
LOAD	[count],
	[pages],
	[next],
	[prev],
	[__FK_info] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_info]);


[origin]:
LOAD	[name],
	[url],
	[__FK_origin] AS [__KEY_results]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_origin]);


[location]:
LOAD	[name_u0] AS [name_u0],
	[url_u0] AS [url_u0],
	[__FK_location] AS [__KEY_results]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_location]);


[episode]:
LOAD	[@Value],
	[__FK_episode] AS [__KEY_results]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_episode]);


[results]:
LOAD	[id],
	[name_u1] AS [name_u1],
	[status],
	[species],
	[type],
	[gender],
	[image],
	[url_u1] AS [url_u1],
	[created],
	[__KEY_results],
	[__FK_results] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_results]);


[root]:
LOAD	[__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY_root]);


DROP TABLE RestConnectorMasterTable;

Back to your example, I would expect the next URL parameter to be root/paging/next/link.