Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
agni_gold
Specialist III
Specialist 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)
2 Solutions

Accepted Solutions
Prashant_Naik
Partner - Creator II
Partner - Creator II

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

 

View solution in original post

andoryuu
Creator III
Creator III

I'd chunk it up by stream.  Here's one that will get you all apps by stream:

(get-qlikstream) | foreach-object {
get-qlikapp -filter ("stream.name eq '{0}'" -f $_.name)
}

 

then to get everything in people's workstreams:

get-qlikapp -filter ("published eq false")

 

 

View solution in original post

6 Replies
iharsh220
Contributor III
Contributor III

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

agni_gold
Specialist III
Specialist III
Author

While running applist code , how i will restrict stream ?

Prashant_Naik
Partner - Creator II
Partner - Creator II

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

 

andoryuu
Creator III
Creator III

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.

skumar
Partner - Contributor II
Partner - Contributor II

Hello, I use Qlik CLI to get the apps list. $Applist = Get-QlikApp -full it works for retrieving smaller count of apps list <=~3000 apps. if the list is large Example  =~ 5000 Apps. throws the error. 

 

System.Net.WebException: The operation has timed out. at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request) at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()

 

any solution appreciated.

 

Thanks

Skumar

andoryuu
Creator III
Creator III

I'd chunk it up by stream.  Here's one that will get you all apps by stream:

(get-qlikstream) | foreach-object {
get-qlikapp -filter ("stream.name eq '{0}'" -f $_.name)
}

 

then to get everything in people's workstreams:

get-qlikapp -filter ("published eq false")