In a list I used column formatting to display a user's profile picture by building a url to the image like this:
"elmType": "img",
"attributes": {
"src": "='/_layouts/15/userphoto.aspx?size=L&username=' + [$iNumber] + '@xxx.com'",
"title": "@currentField"
Where "$iNumber" is the employee's id in a single line of text field (cannot use a people field in this case). Now I want to apply view formatting to improve the entire view, and tried this:
"elmType": "img",
"attributes": {
"src": "=@currentWeb + '/_layouts/15/userphoto.aspx?size=L&username='+ [$iNumber] + '@xxx.com'"
And this using an operator for the url:
"operator": "+",
"operands": [
"/_layouts/15/userphoto.aspx?size=L&username=",
"[@iNumber]",
"@xxx.com"
]
The output when I inspect the element for either is:
src="/_layouts/15/userphoto.aspx?size=L&username=' + [@iNumber] + '@xxx.com'"
So the field value isn't getting pulled in. Is this a formatting error or is it because there's a conflict between the column and view formatting?