Forum Discussion

Jan_Van_Meirvenne's avatar
Jan_Van_Meirvenne
Copper Contributor
Aug 12, 2024

Problems with display country image in sharepoint column

Hi,

I have a sharepoint choice-column for selecting a country based on the iso-code (US,BE,NL,ES,.....)

 

I used json column formatting to display the countryflag :

{
"elmType": "div",
"children": [
{
"elmType": "img",
"attributes": {
"src": "=('https://flagcdn.com/w20/' + toLowerCase(@currentField) + '.png')"
}
},
{
"elmType": "span",
"txtContent": "@currentField"
}
]
}
 
Problem :
when I edit the column : flags are shown.
when display in view mode : the flags are not shown, only the two digitcode !!
 
When i look at the source code, something very strange : there are two "src"-parameter in the img-tag !
 
<img src="" data-untrusted-src="https://flagcdn.com/w20/es.png">
 
Any help will be appreciated
 
 
 
 

 

 

 

No RepliesBe the first to reply

Resources