Does anybody know how I can retrieve the profile picture for a user from salesforce? I need access to the url of the picture.

Is it stored somewhere as a field value?

1 Answer 1


Use user's FullPhotoUrl and SmallPhotoUrl fields

VF code:

       <apex:page controller="cls_PhotoUrl">
                <apex:image value="{!Photolink}"/>

Controller code:

Public class cls_PhotoUrl
     public string Photolink{get;set;}
     Public cls_PhotoUrl()
         User u = [Select u.SmallPhotoUrl, u.FullPhotoUrl 
                     From User u where u.id=:Userinfo.getUserid()];
        Photolink = u.FullPhotoUrl;
  • 1
    I will try it in a moment, you are awesome!
    – Arthlete
    Commented Apr 7, 2016 at 17:39

You must log in to answer this question.

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