Heat_map_pole301 / salesforce_integration.py
Sanjayraju30's picture
Update salesforce_integration.py
4038c08 verified
raw
history blame contribute delete
596 Bytes
from simple_salesforce import Salesforce
# Salesforce Authentication
def authenticate_salesforce():
return Salesforce([email protected], 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']