Forum Discussion

Jay L's avatar
Jay L
Copper Contributor
Feb 17, 2020
Solved

SharePoint Online JSON column formatting on image column.

Hi all,   I have a few images saved in a document library, and i also have a list that contains an image column. When an item is created they select the image from the gallery to add to the list it...
  • RobElliott's avatar
    Feb 17, 2020

    Hi Jay L  the JSON code for formatting the image column is:

    {
    "elmType": "img",
    "style": {
    "width": "100px"
    },
    "attributes": {
    "src": "@currentField"
    }
    }

     

     

    If you want to make it clickable then the JSON is:

    {
    "elmType": "a",
    "attributes": {
    "href": "@currentField",
    "target": "_blank"
    },
    "children": [
    {
    "elmType": "img",
    "style": {
    "width": "150px"
    },
    "attributes": {
    "src": "@currentField"
    }
    }
    ]
    }

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

Resources