Skip to main content

We are trying to access data model for an analysis and are using python script to connect and access data from backend.

We are using Celonis cloud environment ‘TryCelenois’. We have created an apikey in user profile and using same ‘apikey’ during the login process. We have installed few sample applications from ‘EMSStore’. These applications has preconfigured analyses that we are using for our analysis. We are not using any custom data connector and instead using Celonis provided demo data model to provide data to these analyses. We can view data and perform all kind of analysis from the UI on these analyses. However, when we are not able to access datamodel object when trying to access it from external application through ‘pyCelnois’

 

We are using ‘pycelonis’ package to establish connection and extract data from Celonis. We are able to successfully connect with the Celonis system and able to extract the required analysis from the analyses collection. Though we are able to extract most of the properties for this analysis but we are unable to extract ‘datamodel’ associated with the analysis and it throws following error.

 

Datamodel not accessible. App/API key needs access to Pool and Datamodel.

 

The user has ‘Admin’ access and thus apikey created under this user should also have same access. We have also tired to use ‘Application key’ instead of apikey and has granted all permissions to it but still getting same error when accessing datamodel. We tried various demo applications (installed from EMS store) but unable to extract datamodel with any application.

We are wondering if it is some built in limitation with the ‘TryCelenois’ application and/or limitation on access of Worksoft user.

As I had mentioned earlier that we are using demo data models and associated data. Is there any such limitation on demo data models?

 

We have spend many hours to workaround this issue but unable to find any workaround. Any help/pointer shall be greatly appreciated.

Following is snip of code that we are trying to extract data model object.

 

 

from pycelonis import get_celonis

url= https://elegant-tan-magpie.try.celonis.cloud

apikey = "OTQzODViZWQtMzI3ZC00NTBmLWE3ODMtNTA4ZjQzMmU0YmI4OmlaR2hHN2pqU2ROeGgwVHp6ODR4c0YybUZYVjY0NHNsREgxd2hSWTZ4MXRM"

 

myCelenois = get_celonis(url, apikey)

analysisName = "AP - Demo - EN (USD)"

theAnalysis = myCelenois.analyses.namesÂanalysisName]

pool = myCelenois.pools

dataModle= myCelenois.datamodels

 

 

Datamodel not accessible. App/API key needs access to Pool and Datamodel.

 

Hi @obaid.ullah11 

 

I think there are two problems here:

  1. For having access to data pools, you should use an Application Key that is created on a team level instead of an API key on user level. You can create this by going to the team settings, see the screen shot below. Make sure you give it the right permissions to edit the data pool / data model
  2. We did some tests in the past to manipulate the TryCelonis data, without success. It seems that the Event Collection part of these environments is locked, which is reasonable for demo purposes. Even if you would follow the instructions of point 1, I doubt if you will succeed.

 

Kind regards,

Jan-peter

 

application-key


I had tried it with Application key and had assigned all sort of permissions to it but was getting same error.

The strange part is that i was able to extract datamodel with the following REST API

 

https://elegant-tan-magpie.try.celonis.cloud/process-mining/analysis/v1.3/api/analysis/1c68f0e9-3722-4abc-8743-6b23882bbf00/data_model

 

But i need to perform PQL operations for which i need access to datamodel object returned by the python API and i'm unable to extract it.

Any workaround? or it is some known limitation on TryCelonis data?


Hi @obaid.ullah11 ,

 

To be honest, I'm a bit confused. You state that you could extract the data model via the REST API, but later you state that you are unable to extract the data model.. Not sure how to read that.

Nevertheless, Using PyCelonis, you can directly extract data based on PQL statements, as stated in the documentation. Maybe this will help?

 

PQL and Python — pycelonis 1.5.8 documentation

 

Kind regards,

Jan-peter


As i had mentioned, i can execute REST API through postman to extract data model as xml/json. It provides information about tables and columns but i'm unaware of any REST API that can be used to execute PQL. To execute PQL I need access to datamodel object.

Python code can be used to get handle of datamodel object through Pycelonis. However, i am unable to get hold of data model object when trying to access through pycelonis with the following code:

 

myCelenois = get_celonis(url, apikey)

analysisName = "AP - Demo - EN (USD)"

theAnalysis = myCelenois.analyses.namesnanalysisName]

pool = myCelenois.pools

dataModle= myCelenois.datamodel

 

 


Hi @obaid.ullah11,

 

Thanks for the clarification, I now understand the difference you mentioned between the Datamodel Details and the object itself.

Could you please try these queries?

 

```

from pycelonis import get_celonis

celonis = get_celonis() # If you are working in the Machine Learning Workbench, url and apikey are automatically detected

```

 

If this works, and displays 'Login successful! You are using the Application Key.', the problem is not that you don't have access.

 

Then try:

```

from pycelonis import get_celonis

 

celonis = get_celonis()

 

datamodel = celonis.datamodels.find('<datamodel name or ID>')

table = datamodel.tables.find('<table name or ID>')

 

df = table.get_data_frame()

 

display(df)

```

 

If this doesn't work, the data is probably protected, which is very good possible.

 

 

Kind regards,

Jan-peter

 

 

 

 


The 'celonis.datamodels' object returns an empty array and thus celonis.datamodels.find('<datamodel name or ID>') does not returns any object.

Another issue with this approach is that in real application, i will not know the data model name or id associated with the analysis and that is why i was using following syntax to get data models associated with the given analysis. (I'm building an app that extract all analyses and their associated data from any celonis system and integrate it with an external application)

 

datamodels= celonis.analyses.namess'<analysis name or id>'].datamodels

 

The above line produce error Datamodel not accessible. App/API key needs access to Pool and Datamodel.

 

If there was issue with the API key permission then i'd not be able to access datamodel through REST API (unless REST API and Celnois are using different permission set). I'm thinking that it may be some know limitation on the 'TryCelonis' data. But i'm unable to confirm it as i do not have access to any data other than 'TryCelnois'.

 

Thanks,

Obaid


Hi @obaid.ullah11,

 

In the screenshot below you can find the complete code that I used, including the results it should provide. If you don't have any results for the datamodels query while the api key should have permission for it, I'm pretty sure it is locked.

 

Kind regards,

Jan-peter

 

celonis_dataframe_export


Hi Jan,

I did not see any screenshot in your previous message. I'm not able to resolve this issue in spite of several attempts. It seem to me it is an issue with TryCelonis data. To prove it, i guess, i need to establish connection with SAP instance, fetch data, create data model etc. to create a real isnance and then access data model through PyCelenois.


HI Jan, As soon as i send my previous message to see, i can see screen shot. I've tried everything you mentioned there but was getting same error.


Apparently, it was discovered that data model object can not be access in Try Celonis environment, though it can be extracted in real Celonis instance. This is know limitation of Try Celonis.


Reply