Extract Data from salesforce objects using python:
we are trying to extract salesforce Lead object to csv.
we are trying to extract salesforce Lead object to csv.
import pandas as pd
from simple_salesforce import Salesforce sf = Salesforce( username='enter username', password='password', security_token='token from salesforce') sf_data = sf.query_all("SELECT id, Email, FirstName, LastName, OwnerId ,Company, Address FROM Lead") sf_df = pd.DataFrame(sf_data['records']).drop(columns='attributes') print(sf_df['FirstName']) sf_df.to_csv('sample3.csv', index=False)
No comments:
Post a Comment