Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New Contributor

QRS Api limit results

As i know i can send Request to qrs to fetch users with 

as example with
/qrs/user/full?xrfkey=So9WHpq1iiHNG4Ew

I see that /qrs/User/table?take=NUMBER have an additional take param which holds the count how many we want to get, is there anything similiar for /qrs/user/full ?

Greetings

4 Replies
Highlighted
Employee
Employee

Re: QRS Api limit results

I don't quite understand the scenario.

You want to get a limited number of users rather than the full listing? For what goal?

Highlighted
New Contributor

Re: QRS Api limit results

We create an WebApp and the goal is an Autosuggest with Users into the qmc, i want display max 20 Users so i dont need all of them he could find.

There are 2 possible Options to solve this

1. I could enter 3 keys and get all who matched and then save the result in a private Hash and filter this. The advantage would be i have only 1 request to the qrs Rest API. But the Downside i dont know how many users will come, this can be 10, 100 or more. The Response can also be really big.

2. The second approach is ( that one i choosed ) is send a Request and fetch max 20 Users this will result in multiple requests but smaller responses and i dont need to insert any logic to filter Users. Qlik can do this better.

At the end if u try to fetch only 20 Users with /qrs/user/full?filters u cant limit the result server side and the Response will also have all Users he can find.

What now for me worked was the qrs endpoint /qrs/User/table which have 2 important Query Params to solve that,
take and skip. 

And the Question is can i get the same Result as i get with the endpoint /qrs/User/table ( POST ) with /qrs/user/full ( GET ).

Greetings

Highlighted
Partner
Partner

Re: QRS Api limit results

QRS API Reference

It seems there is no take parameter for qrs/user/full or qrs/user/many 
But if I were you I would try it anyway. Sometimes the reference is not complete.

If it doesn't work, either take the full and filter it on the client side or maybe using the qrs/user/table?take=20

Highlighted
Employee
Employee

Re: QRS Api limit results

This may be helpful:

Get the total:

GET /qrs/user/count

Get 50, start at 0 (future iterations can do the maths needed to page through the entire results you will want to adjust the skip param to go to the next page):

POST /qrs/user/table?orderAscending=true&skip=0&sortColumn=name&take=50
{
    "entity": "User",
    "columns": [
        {
            "name": "id",
            "columnType": "Property",
            "definition": "id"
        },
        {
            "name": "name",
            "columnType": "Property",
            "definition": "name"
        },
        {
            "name": "userDirectory",
            "columnType": "Property",
            "definition": "userDirectory"
        },
        {
            "name": "userId",
            "columnType": "Property",
            "definition": "userId"
        }
    ]
}