I am also interested in how to achieve this! I want to take manual input from a user (an integer value) in Analysis sheet and use it as a variable in my Python script.
Hello.
Currently only the OLAP object is available.
You can use the ML Component to send variables to ML.
https://help.celonis.cloud/help/x/fYkeAg
.
As a last resource, you can create a tab with an OLAP and get all the desired values.
Best Regards.
DS Team.
hi Tandonaditi,
There is a solution to do this, but its quite a workaround. Please follow these steps:
- Connect to the Celonis instance using the API key
- Find the analysis you want to extract data from
- Create a back-up of the analysis, this will be saved as an JSON file
- Read the JSON file and find the component you want to extract
- Get the value you want to extract.
Note that in my situation, the KPI component was the only component (thus index 0). You should check the JSON file to determine the index of the component you want, and use that when extracting the value from the dict. If you have multiple KPIs, you can also iterate over the dict content.
Again, its a workaround, but maybe it helps for your use case.
Best regards,
Jan-peter
You can use this code:
import json
# Login
celonis = pycelonis.get_celonis()
# Show all analyses
celonis.analyses
# Select the analysis you want to extract from
analysis = celonis.analyses.find('<<insert_analysis_id>>')
# Create backup and specify the path to store
analysis.backup_content('../data/backups')
# Read JSON file
with open('../data/backups/Backup of Analysis - P2P Setup Data Model Training/published_sheet_01.json',) as f:
# returns JSON object as a dictionary
data = json.load(f)
value = data['components'][0]['kpiValue']
print(value)
code822604 40.3 KB
That was the whole usecase, I want to backup analysis by taking api key, analysis id and other required input from the user by making a dashboard in process analytics and then push those json files to github by taking repo name and token from the same dashboard.
Well, thats then good news. The backing up to Git was one of the example notebooks that was provided some time ago, but unfortunately its not part of the documentation anymore. Good luck with you further project!