Picture not shown in JSON formatted list

Frauke Paetsch 1 Reputation point
2021-11-10T07:53:36.06+00:00

Hi,

I'd like to create a formatted list view with JSON were each row is shown a bit "nicer" :-) That works really well except for the picture not being shown.

148070-screenshot-json-output.jpg

This is how the names look like in the settings (I'm sorry they are in German but I guess you'll get it anyways that I used the correct name):

148131-screenshot-spaltennamen.jpg

This is my code ( I used an example found in the internet and changed it a bit):

{

"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": true,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "div",
"comment": "MAIN DIV",
"attributes": {
"class": "ms-bgColor-neutralLighter"
},
"style": {
"display": "flex",
"flex-wrap": "wrap",
"align-items": "stretch",
"flex-direction": "row",
"padding": "20px",
"margin-bottom": "16px",
"max-width": "850px",
"border-radius": "8px"
},
"children": [
{
"elmType": "div",
"__comment": "DIV 1",
"style": {
"flex-grow": "1",
"display": "flex",
"flex-direction": "column",
"flex-wrap": "nowrap",
"align-items": "stretch",
"max-width": "260px"
},
"children": [
{
"elmType": "img",
"attributes": {
"src": "[$Bild2]"
}
}
]
},
{
"elmType": "div",
"__comment": "DIV 2",
"style": {
"flex-grow": "1",
"display": "flex",
"flex-direction": "column",
"flex-wrap": "nowrap",
"align-items": "center",
"max-width": "360px",
"min-width": "205px"
},
"children": [
{
"elmType": "span",
"txtContent": "[$Title]",
"style": {
"display": "block"
},
"attributes": {
"class": "ms-fontSize-l ms-fontWeight-semibold ms-fontColor-neutralPrimary"
}
},
{
"elmType": "span",
"txtContent": "[$Beschreibung]"
}
]
},
{
"elmType": "div",
"__comment": "DIV 3",
"style": {
"flex-grow": "1",
"display": "flex",
"flex-direction": "column",
"align-items": "center",
"max-width": "310px",
"min-width": "155px"
},
"children": [
{
"elmType": "span",
"txtContent": "Preis",
"style": {
"display": "block"
},
"attributes": {
"class": "ms-fontSize-l ms-fontWeight-semibold ms-fontColor-neutralPrimary"
}
},
{
"elmType": "span",
"txtContent": "= [$Preis]",
"style": {
"display": "block"
}
},
{
"elmType": "span",
"txtContent": "Kontakt",
"style": {
"display": "block",
"padding-top": "20px"
},
"attributes": {
"class": "ms-fontSize-l ms-fontWeight-semibold ms-fontColor-neutralPrimary"
}
},
{
"elmType": "span",
"txtContent": "= [$Kontakt]",
"style": {
"display": "block"
}
}
]
}
]
}
}

Obviously I'm doing something wrong but I have no idea what it is :-(

Thanks for your support

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,176 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 49,846 Reputation points Microsoft Vendor
    2021-11-11T03:01:35.637+00:00

    @Frauke Paetsch

    Have you enabled enhanced rich text in the multiple lines of text column to store image?

    JSON formatting is not supported in the multiple lines of text column which is enabled enhanced rich text.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.