I have a custom object named Student__c, which has a lookup Field User__c to User. I want to create a formula field Avatar__c in Student__c to get the User's profile image to display in this object. I saw there is a standard field named MediumPhotoUrl in the User object. But I cannot access this field in the Avatar__c formula field. Is there any way to access the user profile image?

Here is my Student__c object: enter image description here

The User object has Url for medium profile photo standard field. My User object doesn't have FullPhotoUrl (and I don't know why) enter image description here

I cannot also add MediumPhotoUrl to Avatar__c formula field. Error: Field MediumPhotoUrl does not exist. Check spelling. enter image description here

Hope someone can help me with this problem. If we couldn't get the picture from User, do we have another way to upload picture to Student__c object? Thank you!

1 Answer 1


Unfortunately, you cannot access 'MediumPhotoUrl' in formula fields. You would need to use apex,flow etc., to access MediumPhotoUrl field.

Kindly review limitation here.

Also check how to Use Images in 'Formula' Fields along with Graphics Pack appexchange tool.

  • Hi @Vinay, thanks for your answer. I checked your solution but the Library seems to be available for Salesforce Classic, not Lightning Experience. I couldn't find Libraries in my org. Do you have any solution for Lightning Experience? Dec 7, 2022 at 13:30
  • I am using Salesforce Developer Edition btw Dec 7, 2022 at 13:32
  • Type “Files” on app launcher--> click libraries on the left-hand panel --> click on 'New Library'. You can also check Appexchange tool update on answer
    – Vinay
    Dec 7, 2022 at 19:03

You must log in to answer this question.

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