Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
northerner
Partner - Contributor III
Partner - Contributor III

QRS API: orderby using child property (e.g. stream name)

Hi,

I'm using the QRS API to get a list of apps.  I can sort the list by app name using orderby=name in the query string. I want to be able to be able to sort the list by stream name but I can't figure out how to do this.  Does anyone know if it's possible to apply a sort that uses a child property such as stream.name or stream.id?

Thanks

3 Replies
Levi_Turner
Employee
Employee

Hey Damian,

So it looks like there is a bug on the Repository side whereby standard orderby-ing will not work when the order condition has empty values.

Example Working: /qrs/app/full?orderby=stream.name&filter=(name eq 'zzz')

Example failure condition: /qrs/app/full?orderby=stream.name

So it looks like there is a bug on the Repository side whereby standard orderby-ing will not work when the order condition has empty values.


In lieu of that (while it's getting resolved), you can use

POST /qrs/app/table?orderAscending=true&sortColumn=stream.name

Body:

{

    "entity": "App",

    "columns": [

        {

            "name": "id",

            "columnType": "Property",

            "definition": "id"

        },

        {

            "name": "name",

            "columnType": "Property",

            "definition": "name"

        },

        {

            "name": "owner",

            "columnType": "Property",

            "definition": "owner"

        },

        {

            "name": "publishTime",

            "columnType": "Property",

            "definition": "publishTime"

        },

                {

            "name": "stream",

            "columnType": "Property",

            "definition": "stream"

        }

    ]

}

Hope that helps.

berkayaskin
Partner - Contributor
Partner - Contributor

Hello, 

I do have a pretty similar problem.

I have created a mashup which gets stream, apps and sheets from different api calls and merge into an object which i am keeping that object in React state.

I need custom sorting for streams and sheets. I can sort the sheets by description asc or desc but stream doesn't have a description property on Qlik Sense side.

I gave them custom property named as streamOrder and it's value is starting from 1 to 8. When I check the api call response, each stream has customProperty which is an array of object that includes the the unique values(from 1 to 8 ) I gave but I couldn't apply these custom properties to orderby property on the api call. 

let fetchStreamList = await axios.get(`${process.env.REACT_APP_SERVER_URL}/qrs/stream/full?xrfkey=${process.env.REACT_APP_XRFKEY}&orderby=???`

Would you recommend a solution for that? @Levi_Turner 

Thank you in advance.

 
Levi_Turner
Employee
Employee

This will need to be handled on the client code side since custom properties cannot be ordered in that manner.