Heat_map_pole22 / salesforce_integration.py
Prasanna1622's picture
Update salesforce_integration.py
8ad291c verified
raw
history blame contribute delete
602 Bytes
from simple_salesforce import Salesforce
# Salesforce Authentication
def authenticate_salesforce():
return Salesforce(username='greenenergy@vedavathi.com', password='Vedavathi@04', security_token='jqe4His8AcuFJucZz5NBHfGU')
# Fetch data from Salesforce custom objects (Pole, Sensor Data, Alerts)
def fetch_salesforce_data():
sf = authenticate_salesforce()
# Fetching data from the 'Pole' custom object
poles_data = sf.query("SELECT Id, Name, Latitude__c, Longitude__c, Solar_Output__c, Wind_Output__c FROM Pole__c")
# Return the fetched records
return poles_data['records']