Forum Discussion
Sharepoint list - Column custom format - Download button not working on teams anymore
I have a button to download files on a Teams group file folder as a custom formatted column on sharepoint for a few months, but stopped working (june 29th, 2023). Not sure if there was any update these days, but it was working fine opening the link on my default browser and downloading the file from there.
Trying on a browser it works perfectly, but on teams it seems to try openning an "embedded browser" on teams and closes very fast. Using Ctrl+Click it works, but my users have a very basic skill level.
Have anyone faced the same problem? Is there any workaround like changing the link reference (row 27 below) instead of using the UniqueId?
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"style": {
"cursor": "pointer",
"width": "auto",
"text-align": "center",
"border-radius": "50px",
"margin": "5px 0px",
"padding": "0px",
"border": "none",
"visibility": "=if([$ContentType] == 'Folder', 'hidden', 'visible')"
},
"attributes": {
"class": "ms-bgColor-themePrimary ms-fontColor-white"
},
"children": [
{
"elmType": "a",
"txtContent": "Download",
"style": {
"text-decoration": "none",
"padding": "10px 0px",
"width": "100%"
},
"attributes": {
"href": "= @currentWeb + '/_layouts/15/download.aspx?UniqueId=' + [$UniqueId]",
"target": "_blank",
"class": "ms-fontColor-white"
}
}
]
}
(CTRL+Click is not enough, needs to be easier)
found a workaround..
deleted the 'target' attribute and changed the [$UniqueId] without curly brackets (using replace as shown on the image below)
1 Reply
- roger-haragushikuCopper Contributor
found a workaround..
deleted the 'target' attribute and changed the [$UniqueId] without curly brackets (using replace as shown on the image below)