You need to sign in to do that
Don't have an account?
Aleksandra Czepierga
Get account owner with pyton simple salesforce
Hi! Is is possible to get account owner with simple salesforce?
What I am trying:
But result of get_owner('0013c00001pb0BAAAY') is
OrderedDict([('totalSize', 2), ('done', True), ('records', [OrderedDict([('attributes', OrderedDict([('type', 'Contact'), ('url', '/services/data/v42.0/sobjects/Contact/0033c00002UZTOWAA5')])), ('AccountId', '0013c00001pb0BAAAY')]), OrderedDict([('attributes', OrderedDict([('type', 'Contact'), ('url', '/services/data/v42.0/sobjects/Contact/0033c00002Uatx1AAB')])), ('AccountId', '0013c00001pb0BAAAY')])])])
How to get only id or name?!
What I am trying:
def get_owner(par): data = sf.query(format_soql("SELECT AccountId FROM Contact WHERE AccountId = {}", par)) print(data)
But result of get_owner('0013c00001pb0BAAAY') is
OrderedDict([('totalSize', 2), ('done', True), ('records', [OrderedDict([('attributes', OrderedDict([('type', 'Contact'), ('url', '/services/data/v42.0/sobjects/Contact/0033c00002UZTOWAA5')])), ('AccountId', '0013c00001pb0BAAAY')]), OrderedDict([('attributes', OrderedDict([('type', 'Contact'), ('url', '/services/data/v42.0/sobjects/Contact/0033c00002Uatx1AAB')])), ('AccountId', '0013c00001pb0BAAAY')])])])
How to get only id or name?!
The below video blog will guide you on how to get account owner,
https://www.youtube.com/watch?v=_FHD3pjKrbY
I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.
Thanks.