EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB486813: How to List All available Dashboards in a Specific Environment Using Python Script in MicroStrategy WorkStation


Rainiero Leon

Support Engineer • MicroStrategy


This article outlines how to use a Python script to list all the dashboards in WorkStation for a specific MicroStrategy environment. This script greatly enhances productivity and efficiency by removing the need for the time-consuming manual process of listing all dashboards in large environments.

Symptom

Users might want to enumerate all dashboards in a specific Strategy environment. Not having a method to do this can make managing a large environment inefficient, as manually listing all dashboards can be a tedious process.

Cause

The challenge is to have a method to List all Dashboards in a particular Environment in bulk. This limitation forces administrators to spend extra time and effort to manually to List all Dashboards in a particular Environment .

Solution

To List all Dashboards in a particular Environment   with a Python Script, follow these detailed steps in the Strategy WorkStation:
1. Connect to Your Environment: Initialize the connection to your Strategy environment.
2. Navigate to Administration: Access the administration panel to manage scripts.
3. Access Scripts Section: Go to the scripts section where you can create or modify scripts.
4. Select Your Environment: Choose the appropriate environment where the script will be executed.
5. Open Gallery Tab: In the right section of the interface, select the Gallery tab to view available workflows and scripts.
6. Expand Code Snippet: Discover and expand the Code Snippet section to access various scripts. You can also use the search box and enter ' Dashboards’.
7. Launch ' Dashboard’ Code Snippet: Double-click on ' Dashboards’ Code Snippet to open it.
8. Execute the Script: Hit the run button to execute the script and programmatically List all Dashboards in a particular Environment '.

ka0PW0000002RfFYAU_0EMPW000007YhBO.jpeg

The python script that can be found find within Strategy WorkStation and is also available here https://github.com/Strategy/mstrio-py/blob/master/code_snippets/dashboard.py 
A sample Python script is given below, which can be copy-pasted and used in the Project 'Strategy Tutorial' for all Dashboards


"""This is the demo script to show how to manage Dashboards and list Dashboards with different conditions. 
"""

from mstrio.connection import get_connection
from mstrio.project_objects.dossier import (
    Dossier,
    list_dossiers,
    list_dossiers_across_projects
)

# Define a variable which can be later used in a script
PROJECT_NAME = "Strategy Tutorial"  # Insert name of project here

conn = get_connection(workstationData, PROJECT_NAME)

# Dossier management
# List dossiers with different conditions
list_of_all_dossiers = list_dossiers(connection=conn)
print(list_of_all_dossiers)
list_of_all_dossiers_as_dicts = list_dossiers(connection=conn, to_dictionary=True)
print(list_of_all_dossiers_as_dicts)
list_of_all_dossiers_as_dataframes = list_dossiers(connection=conn, to_dataframe=True)
print(list_of_all_dossiers_as_dataframes)

Disclaimer 

Customization Warning: This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.

Related articles 

Python within Workstation https://www2.Strategy.com/producthelp/Current/Workstation/en-us/Content/intro_scripts.htm 
Preview Python Scripts https://www2.Strategy.com/producthelp/Current/Workstation/en-us/Content/preview_scripts.htm
mstrio-py https://github.com/Strategy/mstrio-py 
https://www2.Strategy.com/producthelp/Current/Workstation/en-us/Content/intro_scripts.htm 
 


Comment

0 comments

Details

Knowledge Article

Published:

July 18, 2024

Last Updated:

July 18, 2024