Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for 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
Highlighted
Valued Contributor III

getAppLists from all streams except one.

Hello Everyone, 

 

I am trying to get all the app from the server, but my requirement is to restrict one particular stream.

getAppList method has one property qMeta , inside that I can see stream name, but when I applying a filter based on that, it is not showing me the correct set of apps.

 

Please suggest any solution.

 

 

 

 

Labels (1)
4 Replies
Highlighted
New Contributor III

Re: getAppLists from all streams except one.

hello,

there is engine api called GetStreamlist  in global

you can get all the list of stream

if streamid or streamname  !=  "demo"

then run your applist code.

thanks regards

Harsh Gohil

Highlighted
Valued Contributor III

Re: getAppLists from all streams except one.

While running applist code , how i will restrict stream ?

Highlighted
Partner
Partner

Re: getAppLists from all streams except one.

Hi,

As harsh said, using the getdoclist() method you can get the list of apps and other properties of the apps with the stream name and id too.

So put a condition that which app you want from which stream or not and create a array for the list of app that you want and display that.(please check below highlighted words)

{
"qDocName": "Executive Dashboard",
"qConnectedUsers": 0,
"qFileTime": 0,
"qFileSize": 1506395,
"qDocId": "app id",
"qMeta": {
"createdDate": "2019-10-16T06:53:52.562Z",
"modifiedDate": "2019-10-16T06:53:57.876Z",
"published": false,
"publishTime": "1753-01-01T00:00:00.000Z",
"privileges": [
"read",
"update",
"delete",
"publish",
"offlineaccess",
"duplicate"
],
"description": "Executive Dashboard",

"dynamicColor": "hsla(356,18%,43%,1)",
"create": null,
"stream": {                     //this is the data where you can see the stream name and id
"id": "aaec8d41-5201-43ab-809f-3063750dfafd",
"name": "Everyone"
},

"canCreateDataConnections": false
},
"qLastReloadTime": "2016-06-13T18:47:30.171Z",
"qTitle": "Executive Dashboard",
"qThumbnail": {
"qUrl": "/thumb-executive_dashboard.png"
}
}

restricting the stream will give you the applist you wanted.

You need to put a loop from the Json data get from engine and put condition on that and for excluding the specific stream apps

Note : You need to exclude the stream that have Null as value.

This might help you.

Thanks & Regards,

Prashant

 

Highlighted
Contributor III

Re: getAppLists from all streams except one.

As a side note I prefer to use the QSR API for app lists and simple filtering and Qlik-CLI makes this rather easy when using PowerShell (but you can apply the same principle to JavaScript, C#, whatever).  

Get-QlikApp -filter "stream.name ne 'StreamToExclude'" | %{$_.Name}

Instant return of all apps except the ones in that stream.