Forum Discussion
CJS81000
Feb 07, 2025Copper Contributor
Re: SharePoint List - Select from a Choice Field and Display an Image
Rob, I followed your instructions & used your code (changing the dropdown references & image URLs to my own), but the images just show in the list up as empty boxes. Any thoughts?
3 Replies
Sort By
- Rob_ElliottBronze Contributor
Make sure the images are stored on SharePoint, not externally. Other than that, without seeing your JSOn I can't tell if you've made an error.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)- CJS81000Copper Contributor
Thanks for the reply, Rob_Elliott. Here's my code:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "children": [ { "elmType": "img", "style": { "position": "relative", "top ": "50%", "left": "50%", "width": "24px", "height": "24px", "margin-left": "-50%", "margin-top": "0%" }, "attributes": { "src": "=if(@currentField == 'Consistently Positive', 'https://MYCOMPANYNAME.sharepoint.com/:i:/r/sites/MYDEPARTMENTNAME/Shared%20Documents/_Resources/Trend%20Arrows/consistently%20positive%20trend%20(up%20arrow).png?csf=1&web=1&e=PalSfh', if(@currentField == 'Recently Positive', 'https://MYCOMPANYNAME.sharepoint.com/:i:/r/sites/MYDEPARTMENTNAME/Shared%20Documents/_Resources/Trend%20Arrows/recent%20positive%20trend%20(up-right%20arrow).png?csf=1&web=1&e=faw6kP', if(@currentField == 'Neutral','https://MYCOMPANYNAME.sharepoint.com/:i:/r/sites/MYDEPARTMENTNAME/Shared%20Documents/_Resources/Trend%20Arrows/neutral%20trend%20(right%20arrow).png?csf=1&web=1&e=YbDLiG', if(@currentField == 'Recently Negative','https://MYCOMPANYNAME.sharepoint.com/:i:/r/sites/MYDEPARTMENTNAME/Shared%20Documents/_Resources/Trend%20Arrows/recent%20negative%20trend%20(down-right%20arrow).png?csf=1&web=1&e=hk1MAM', if(@currentField == 'Consistently Negative','https://MYCOMPANYNAME.sharepoint.com/:i:/r/sites/MYDEPARTMENTNAME/Shared%20Documents/_Resources/Trend%20Arrows/consistently%20negative%20trend%20(down%20arrow).png?csf=1&web=1&e=CzakF5')))))" } } ] }
- CJS81000Copper Contributor
Rob_Elliott, any insights you can provide would be greatly appreciated. Thanks!