1. Home
  2. Knowledge Base
  3. Microsoft
  4. SharePoint
  5. With json in SharePoint online from link to graphic

With json in SharePoint online from link to graphic

… with this code you can display thumbnails directly in a SharePoint list. The link to a graphic file in a text field serves as the basis! For example, if you have a customer in a lookup field, you can also display the logo as a graphic.

{
  "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "img",
      "attributes": {
        "src": "@currentField",
        "title": "=if(@currentField == '', '', @currentField)"
      },
      "style": {
        "position": "relative",
        "top": "50%",
        "left": "50%",
        "width": "48px",
        "height": "auto",
        "margin-left": "-50%",
        "margin-top": "0%"
      }
    }
  ]
}

Dieser Beitrag ist auch verfügbar auf: Deutsch (German)

Was this article helpful?

Related Articles

Submit a Comment

Your email address will not be published. Required fields are marked *

Published on - 24. May 2020
Modified on - 2. Apr 2024
Views - 53
Likes - 0

Do you need help?

Kontaktiere uns gerne :-)
Contact Support
Skip to content