I am trying to pull data from Dynamics CRM 365 Online via Python3. During my research, I read that JayDeBeAPi was a good library to pull data from Dynamics CRM 365 Online. I successfully pip installed the library and tested the "import jaydebeapi" command.
I manage to connect to CRM, as there is no error message coming, but my script is not returning any row. I tried to both fetch the information from JayDeBeApi and/or Pandas, but I am still struggling with pulling data from CRM.
I have tried so far: - Access to Dynamics CRM 365 Online by using the jaydebeapi.connect() method - Execute a SELECT query via execute() or pandas.read_sql() method - Retrieve the rows via fetchall() method or simply printing the resulting dataframe.
import pandas as pd
import jaydebeapi
conn = jaydebeapi.connect('https://org.dynamics.com','datos.jdbc.dynamicscrm.jar', 'jdbc:dynamicscrm:',
{'user': "myaccount@email.com", 'password':"some_password"},
"C:/Program Files/.../datos.jdbc.dynamicscrm.jar",)
curs = conn.cursor()
curs.execute("select Name, Amount from Opportunities")
curs.fetchall()
curs.close()
conn.close()
### I have tried also:
df = pd.read_sql("select Name, Amount from Opportunities", conn)
print(df)
I expect something like this:
# Name Amount
1 Tina 2000
2 Amanda 3000
3 Joseph 5000
4 Erick 6000
Thanks for the help and suggestions you can provide on successfully pulling data from Dynamics CRM 365 Online.