I am trying to get the file icons displayed in the standard view in the document libraries:
I want them to be displayed on a custom "file card" alongside the filename and a preview.
The SE article linked here didn't help as they suggest using the Fabric Icons. But I want the original SharePoint icons.
Edit: I added this code below to take care of different filetypes. Works like a charm.
"attributes": { "src": "='https://spoprod-a.akamaihd.net/files/fabric-cdn-prod_20201207.001//assets/item-types/20/' +
if([$File_x0020_Type] == 'docx'|| [$File_x0020_Type] == 'dotx' ||
[$File_x0020_Type] == 'pptx' || [$File_x0020_Type] == 'potx' ||
[$File_x0020_Type] == 'ppsx' || [$File_x0020_Type] == 'xlsx' ||
[$File_x0020_Type] == 'pdf' || [$File_x0020_Type] == 'zip'||
[$File_x0020_Type] == 'txt' || [$File_x0020_Type] == 'folder', [$File_x0020_Type], if([$File_x0020_Type] == 'mp4' ||
[$File_x0020_Type] == 'mpg' || [$File_x0020_Type] == 'avi', 'video',
if([$File_x0020_Type] == 'jpg' || [$File_x0020_Type] == 'gif' ||
[$File_x0020_Type] == 'png' || [$File_x0020_Type] == 'png','photo',
if([$File_x0020_Type] == 'json', 'code', if([$File_x0020_Type] == 'eml' ||
[$File_x0020_Type] == 'msg', 'email', 'genericfile'))))) + '.svg'"