0

I'm trying to get a photo to show on my view. Tried the below but it won't work:

  "attributes": {
              "src": "='https://aaa.sharepoint.com/sites/XXX/_layouts/15/userphoto.aspx?size=S&accountname=' + [$Email]",
              "title": "[$Display_x0020_Name]"
            }

The Email field is an email address. Any ideas what I'm doing wrong?

3
  • Did you add "Email" column to your list view? Add Email column to list view & try using: "src": "='/_layouts/15/userphoto.aspx?size=S&accountname=' + [$Email]",. Make sure you are using correct internal name of Email column. Commented Feb 16, 2022 at 4:55
  • 1
    I eventually realised that (adding the field to the list view) Thanks
    – naijacoder
    Commented Feb 16, 2022 at 6:45
  • Great, glad it worked for you. Commented Feb 16, 2022 at 6:57

1 Answer 1

0

Your JSON code seems good to me. Please make sure below things:

  1. You added "Email" column to your list view - This is required to reference "Email" in JSON formatting.

  2. You are using correct internal name of email column in JSON ([$InternalNameOfColumn]). You can get the exact internal name of your email column by following this article: How to find the Internal name of columns in SharePoint Online?

Documentation: Use view formatting to customize SharePoint

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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