JSON SharePoint list view - background-image doest not work
Question
I found in documentation that "background-image" is supported attribute but I am not able to use it. Maybe I am doing something wrong. Could you help please, how to use "background-image" within JSON code?
Example:
{
"elmType": "div",
"style": {
"text-align": "left",
"background-image": "url('https://test.sharepoint.com/sites/TEST/SiteAssets/company_logo.png')"
}
...
Thank you,
Mirek
La solution
This is expected behavior.
Currently style properties cannot have any of the following characters: (
, :
, &
, ;
, !
.
If you will add "debugMode": "true"
to your JSON code, you can see the error message like below in browser's console:
You can read more information about this issue at: Column formatting - URL not allowed in background-image style property
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange