You need to sign in to do that
Don't have an account?

Need to fetch User ids from User Emails of a Object field
I have a field named recepient which contains both Salesforce users and Non salesforce users EMAIL IDS.
I need to SOQL to find the User Ids of Salesforce Users and exclude the Non Salesfoerce users.
How do I need to achieve this
I need to SOQL to find the User Ids of Salesforce Users and exclude the Non Salesfoerce users.
How do I need to achieve this
First you have to query the recepient email ids and take it to a list say list<id> RecepientId.
then do the following code
list<user> UserId= [select id,name from user where Email in :RecepientId];
this will do your requirement.
Thankyou.
PS: Pls mark as best answer if it helped
Thanks for reply.
Consider I have field with 5 email ids(comma seperated) in a text field. Out of 5 only 3 are SF users and remaining 2 aren't.
How do I query if i have multiple email ids in one field as above
Ex:
Field contains: 12@abc.com, 34@abc@.com, 56@abc.com, 78@abc.com, 90@abc.com
Out of these only first 3 emails have salesforce users and last 2 doesnt have.
How do I perform SOQL in this case
thanks
For that first you need to split your string field with comma.Try something like below,
Regards