I'm using the process builder to create a task and assign it to the case owner. If the case owner is a queue then creating the task fails with the following error:

FIELD_INTEGRITY_EXCEPTION: Assigned To ID: id value of incorrect type

While this scenario will likely never happen I'd like to address the possibility by determining if the owner is a user or queue and only attempt to create the task if owned by a user.

I've tried various conditions, but none of them have worked. As an example:

[Case].Owner:Queue.OwnerId Is Null = True

This criteria doesn't work because the process builder will fail if the owner actually is a user (the 99.999% use case). The failure message is:

The flow failed to access the value for myVariable_current.Owner:Queue.OwnerId because it hasn't been set or assigned.

It seems like I'm stuck. I can't access queue owner information if the owner is a user, and vice-versa I can't access user owner information if the owner is a queue.

How can I safely determine if the owner is a user or a queue?


Just check the first three digits of the OwnerId field (the key prefix for the Id). You can use a formula criterion here.

Is owned by User:

BEGINS([Case].OwnerId, "005") 

Is owned by Queue:

BEGINS([Case].OwnerId, "00G") 
|improve this answer|||||
  • If there are multiple conditions, will putting the BEGINS([Case].OwnerId, "005") first in an AND group prevent the rest of the conditions from being evaluated if it fails? E.g. if you have a subsequent condition that is evaluating Owner.User.Profile.Name, you do not want it evaluated at all when the owner is a queue. – AlwaysThinkin Aug 29 '18 at 17:56

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.