I am new to salesforce, I am using the below query to fetch data from Salesforce Approval Process, Here actorId is the Id which matches with the Id of User table. I need User email from the User table along with below values in the query. How can i do that?

SELECT SystemModstamp, Createddate, actorId, processinstance.status, processInstance. targetobjectid FROM ProcessInstanceWorkitem
  • DO you need user email for sending email via Apex? Aug 2, 2018 at 11:59

1 Answer 1


You can use parent level subquery actor.Email

SELECT SystemModstamp, Createddate, actorId, actor.Email,
       processinstance.status, processInstance.targetobjectid 
  FROM ProcessInstanceWorkitem
  • That is actor's email. Actor ID is same as User ID in User table. I need to match that user ID and get the User.Email. As both of the emails are different
    – John K
    Aug 2, 2018 at 7:41
  • @JohnK here Actor is a User. Only the field definition is changed for user. Actor.Email will give you the exact user details.
    – Ratan Paul
    Aug 2, 2018 at 7:45
  • I have tried that, as the actor is who is assigning the approval process. But User is who is approving the line item. So both are different. In that case, i need User Email instead of Actor Email. The connection between Actor and User tables is ID. (ActorId and UserId). I have actor ID.
    – John K
    Aug 2, 2018 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.