change image in column and row

Meg OliverChild 61 Reputation points
2020-08-19T08:27:01.117+00:00

Hi all, :)

I used the Json script given in my last Q (that was really helpful and I appreciated it soooo much) :) :)

In the image I have two logos the same within one column but I would like to be able to change the image in the highlighted area so no two images are the same.

18727-capture2.jpg

Hope you can help because I cant find the answer to my Q and I do use this as the last resort. :{

JSON code I'm using:

{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"elmType": "a",
"attributes": {
"href": "@currentField",
"target": "_blank"
},
"children": [
{
"elmType": "img",
"style": {
"width": "150px"
},
"attributes": {
"src": "https://tenant.sharepoint.com/:i:/r/sites/SafeWorkAuthorisations/SiteAssets/images/Pyro-purple.png?csf=1&web=1&e=1Jr8Ur"
}
}
]
}

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,339 questions
0 comments No comments
{count} votes

Accepted answer
  1. JoyZ 18,066 Reputation points
    2020-08-20T04:44:58.7+00:00

    We could use expression (=if) to display different logos based on column value:

    19414-image.png

    Result:

    18984-image.png

    Please refer to the code in text file:

    19346-column-formatting.txt

    And please note this is a public forum. In order to protect your personal privacy, we do not recommend you contain your personal information in the code, such as your tenant name.


0 additional answers

Sort by: Most helpful

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.