Forum Discussion
How to return ALL results in API call
I would have expected the [contactID] to be part of your WebCall - otherwise: How should the WebCall make the next call?
each [ WebCall = Json.Document(Web.Contents("https://ws-use.brightpearl.com/public-api/dude/contact-service/contact-search?isCustomer=true&column...]), [Headers=[#"brightpearl-app-ref"="dude_powerbi-1", #"brightpearl-account-token"="%%%%"]])),
I don't know why the WebCall was showing as a link and cutting off the entire text. Please see revised post without the hyperlink. Thanks!
- ImkeF9 years ago
Community Champion
The query would paginate if the result of your WebCall contained a field named "lastKey". Do you really have that field or does the number for the next page sit in a different field/column?
- twilkdaddy9 years agoFrequent Visitor
As far as I can see, there aren't any lastkey fields. I thought that was some sort of built in variable as a last record identifier.
Here's a snapshot of the last piece of results yielded out of ARC (-499 is the last array of results containing the desired variable values):
-499: [Array[4]
[],0: 768,1: "1986",2: "Krystin",3: "Hand"],"metaData":-0: {"morePagesAvailable": true,"resultsAvailable": 16650,"resultsReturned": 500,"firstResult": 1,"lastResult": 500,"columns": [1: {"name": "contactId","sortable": true,"filterable": true,"reportDataType": "IDSET","required": false},2: {"name": "companyName","sortable": true,"filterable": true,"reportDataType": "SEARCH_STRING","required": false},3: {"name": "firstName","sortable": true,"filterable": true,"reportDataType": "SEARCH_STRING","required": false},],4: {"name": "lastName","sortable": true,"filterable": true,"reportDataType": "SEARCH_STRING","required": false}"sorting": [],{"filterable":{"name": "contactId","sortable": true,"filterable": true,"reportDataType": "IDSET","required": false},"direction": "ASC"}- twilkdaddy9 years agoFrequent Visitor
Any suggestions on how to create or identify that variable to identify the "number for the next page" you mentioned?
Was I provided in the last post helpful at all for troubleshooting where my code problem is?