Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ali-soy
Contributor
Contributor

WooCommerce REST API Pagination: get more than 10 records

Hello everyone

I'm very new in REST API with Qlik Sense and WooCommerce. I could successfully establish a REST API Connection to WooCommerce 4.8.0. I can load at least the records from the tables - yeah!

But... I don't geht more than 10 records. I've checked the WooCommerce REST API Documentation (https://woocommerce.github.io/woocommerce-rest-api-docs/#parameters) -> I've learned that the limitation of 10 records comes from the default setting in WooCommerce. With Pagination settings in Qlik I should be able to get more data. But I'm not able to show on my page. Even if the loading process shows that 13'920 records were loaded:

ali-soy_0-1619443507851.png

my WooCommerce Settings:

ali-soy_1-1619443542248.png

ali-soy_2-1619443563008.png

ali-soy_3-1619443577895.png

ali-soy_4-1619443588853.png

 

Pagination Settings

ali-soy_5-1619443601148.png

ali-soy_6-1619443617925.png

 

Pagination on WooCommerce Documentation

ali-soy_7-1619443811445.png

 

Script:

LIB CONNECT TO 'WooCommerce REST';
 
RestConnectorMasterTable:
SQL SELECT 
"__KEY_root",
(SELECT 
"first_name",
"last_name",
"company",
"address_1",
"address_2",
"city",
"state",
"postcode",
"country",
"email",
"phone",
"__FK_billing"
FROM "billing" FK "__FK_billing")
FROM JSON (wrap on) "root" PK "__KEY_root";
 
[billing]:
LOAD [first_name],
[last_name],
[company],
[address_1],
[address_2],
[city],
[state],
[postcode],
[country],
[email],
[phone],
[__FK_billing] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_billing]);
 
 
DROP TABLE RestConnectorMasterTable;
LIB CONNECT TO 'WooCommerce REST';
 
RestConnectorMasterTable:
SQL SELECT 
"id" AS "id_u10",
"parent_id",
"number",
"order_key",
"created_via",
"version",
"status",
"currency",
"date_created",
"date_created_gmt",
"date_modified",
"date_modified_gmt",
"discount_total",
"discount_tax" AS "discount_tax_u0",
"shipping_total",
"shipping_tax",
"cart_tax",
"total" AS "total_u1",
"total_tax" AS "total_tax_u0",
"prices_include_tax",
"customer_id",
"customer_ip_address",
"customer_user_agent",
"customer_note",
"payment_method",
"payment_method_title",
"transaction_id",
"date_paid",
"date_paid_gmt",
"date_completed",
"date_completed_gmt",
"cart_hash",
"currency_symbol",
"__KEY_root"
FROM JSON (wrap on) "root" PK "__KEY_root";
 
[root]:
LOAD [id_u10] AS [id_u10],
[parent_id],
[number],
[order_key],
[created_via],
[version],
[status],
[currency],
[date_created],
[date_created_gmt],
[date_modified],
[date_modified_gmt],
[discount_total],
[discount_tax_u0] AS [discount_tax_u0],
[shipping_total],
[shipping_tax],
[cart_tax],
[total_u1] AS [total_u1],
[total_tax_u0] AS [total_tax_u0],
[prices_include_tax],
[customer_id],
[customer_ip_address],
[customer_user_agent],
[customer_note],
[payment_method],
[payment_method_title],
[transaction_id],
[date_paid],
[date_paid_gmt],
[date_completed],
[date_completed_gmt],
[cart_hash],
[currency_symbol],
[__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY_root]);
 
 
DROP TABLE RestConnectorMasterTable;
 

---------

My question to the community:

Do I something wrong im my pagination settings?

Thank you for your help!!!!

 

Labels (1)
  • SaaS

0 Replies