0

I'm trying to use a batch request to see if a record exists based on either auth0id or email in our db. In the same trip to the server, if the record exists, I'd like to bring back the recordType id of that record.

What I have so far is below. One major problem here is I don't know how to have acc defined (I want to specify to pull Auth0_user_id and email from the Account object) in the last query. In general though I just haven't seen people pulling one record's specific recordType id. I see people asking how to pull all recordType ids for each object.

compositeData = {
            "batchRequests": [{
                "method": "GET",
                "url": f"/services/data/v50.0/query/?q=select+id+from+Account+where+Auth0_User_ID__c='{auth_id}'"

            }, {
                "method": "GET",
                "url": f"/services/data/v50.0/query/?q=select+id+from+Account+where+conference360__Email__c='{email}'"
            }, {
                "method": "GET",
                "url": f"/services/data/v50.0/query/?q=select+id+from+recordtype+where+sobjecttype='Account'+and+(acc.Auth0_User_ID__c='{auth_id}'+or+acc.conference360__Email__c='{email}')"
            }]
        }

Note: auth_id and email are parameters passed to my function.

2
  • 1
    Why aren't you including RecordTypeId in your SELECT statement? Commented Jan 19, 2021 at 0:40
  • Oh my! Such an obvious answer!! Thank you
    – sFishman
    Commented Jan 19, 2021 at 7:28

1 Answer 1

0

See David Cheng's comment above. So obvious - just add RecordTypeId into my select statements!

compositeData = {
            "batchRequests": [{
                "method": "GET",
                "url": f"/services/data/v50.0/query/?q=select+id,+RecordTypeId+from+Account+where+Auth0_User_ID__c='{auth_id}'"

            }, {
                "method": "GET",
                "url": f"/services/data/v50.0/query/?q=select+id,+RecordTypeId+from+Account+where+conference360__Email__c='{email}'"
            }
            ]
        }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .