I'm writing an IF statement in JSON formatting to get a particular image for a card view.
Basically, if the SharePoint field 'IndOrTeam' equals 'Team', then a group image stored in Site Assets is shown. This is working fine, however if 'IndOrTeam' does NOT equal 'Team' I want to show the user's profile picture, who is set in the 'AssignedTo' field. I know this can be accessed by the operator '=getUserImage([$AssignedTo], 'L')' but I can't get it to work in the IF statement.
If I remove the IF statement altogether, the user profile pic is shown as expected. The code is below. Does anyone know why it isn't showing the user profile image:
elmType": "img", "style": { "width": "150px", "height": "150px", "border-radius": "50%", "border": "1px solid" }, "attributes": { "src": "=if([$IndOrTeam] == 'Team','https://xxxxx.sharepoint.com/sites/Intranet/SiteAssets/groupusers.png','=getUserImage([$AssignedTo.email], 'L')'", "class": "ms-fontColor-neutralTertiaryAlt" }, "defaultHoverField": "[$AssignedTo]" } Thanks in advance.