Xano Documentation
Search…
πŸ’‘
Start here
☁️ Your Xano Account
πŸ’²
Special Discount Pricing
External Paging

First, create an input that is a JSON data type.
In this example, we have added a JSON input named external to the GET all users API endpoint.
Secondly, open the Query all Records function. In the Output tab, under return enable paging.
In the Output tab of the Query all Records function, click the pencil icon next to Return to enable paging.
Select the checkbox next to enable paging and click save.
​
Next, link the configuration in the External query tab to the JSON input using the drop down menu. Additionally, select "Allow Page Override" and "Allow Per Page Override" permission. (Note: you can choose just one between Page Override and Per Page Override or both. Determine what works best for your use case).
In this example, we linked up the external configuration with the JSON input "external." Then we selected permissions to allow page and per page override. Note: you can choose one or the other or both depending on your requirements.
Now, we are ready do paging by the external query. Because the external query takes a JSON input, we must format the input in a JSON like the examples below.
In this example, "external" is the name of our JSON input. It is not required as part of the input but used as an example name.
The below JSON object uses both Page Override and Per Page Override. It will return page 1 and 2 items per page:
{
"external":{"page":1, "per_page":2}
}
​
The below JSON input would be used for just Page Override:
{
"external":{"page":1}
}
​
The below JSON input would be used for just Per Page Override:
{
"external":{"per_page":2}
}
​

Front-ends can sometimes have limitations as far as the data you are able to pass as an input. Fortunately, Xano is super-flexible to allow you to workaround these limitations. If you are having issue passing a JSON object as an input in your front-end then you can create the object in the Function Stack as a variable and make it dynamic with scalar inputs.
This method is also handy if you want to use page and per page as query and URL parameters.

Create inputs "page" and "per_page" as integer input types. (Or if you are just using one of the overrides use just that one).

Add a Create Variable Function to your Function Stack and drag it to the top. Create the following JSON structure using the SET filter or import JSON action.
{
"page": "",
"per_page": "1"
}
Then, choose the inputs as the values for the corresponding paths:
Create the JSON structure in a variable using the SET filer or import JSON. Map the dynamic inputs as values to their corresponding paths.

Ensure paging is enabled on the output tab of Query All Records.
Enable paging.
Then, on the External tab map the variable you created to the By External Query dropdown and select Allow Page Override and Allow Per Page Override. (If you are only using one then just select that one).
Map the variable created in step two to the external tab and select paging overrides.
Click save and you're ready to go.
Copy link
On this page
Alternative to JSON input