Code Sample
The following code snippet is sufficient to pull a list of available Dashboards (with all relevant metadata) and log an array of Dashboard metadata objects into console:
visualize({ auth: { name: "joeuser", password: "joeuser", organization: "organization_1" } }, function(v) { v.resourcesSearch({ folderUri: "/public/Samples", recursive: true, types: ["dashboard"], success: function(repo) { console.log(repo); }, error: function(err) { console.log(err); } }); });
If you wish to only search a specific folder but not its subfolder, simply disable the recursive search:
recursive: true
You can also search for other resource types, as well as multiple resource types in the same search:
types: ["dashboard","reportUnit"]
Here is a client side code sample on JSFiddle.net platform which looks up Dashboards in /Public/Samples directory and renders the list of found Dashboard names in a drop down list:
https://jsfiddle.net/Stas_P/cn0e7a6b/
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now