Page 1 of 1

API REST - GET/API/LIST/{table} - How to get all records from a table?

Posted: Sat Jan 27, 2024 12:12 am
by lfernandes

I am applying the Code Example of REST API to list the table records, however the return is limited to the project configuration that sets the number of records per page. I would like to understand how I can get all records of the table

    let object = "<Table>", // Replace <Table> by actual table name

    $.get("/api/list/" + object + "/" , function(res) { // Get response from View page API
        if (res && res.success) {
            let row = res[object];
            alert(JSON.stringify(row)); // Show output JSON
        } else {
            alert(res.failureMessage);
        }
    });

Re: API REST - GET/API/LIST/{table} - How to get all records from a table?

Posted: Sat Jan 27, 2024 7:22 am
by MichaelG

Check the recperpage parameter for the list page API action.


Re: API REST - GET/API/LIST/{table} - How to get all records from a table?

Posted: Sun Jan 28, 2024 1:04 am
by lfernandes

Ok Michael! However, you can exemplify how to apply this parameter to the API action on the list, with the objective of returning all records in the table


Re: API REST - GET/API/LIST/{table} - How to get all records from a table?

Posted: Sun Jan 28, 2024 7:59 am
by MichaelG

Assuming you have enabled the Page sizes (records) = all option, you can use the recperpage=all option to list all records of the table.