Forum Discussion
Get file download data
Hello!
Is it possible to grab download data from SharePoint? Like X downloads in May etc.
I know there's nothing out-of-the-box and I could use the compliance centre but I was hoping for something automatic. Can I grab this data using Power Automate??
RMDUser1 I was just looking at a list I created a couple of years ago and realised that what I did with JSON formatting could go some way to answering your question.
In the example below I have a hyperlink column called Link and a number column called ClickCount. When the user clicks the link it opens a document from a library. You can format the Link column in advanced mode with the following JSON which will add 1 to the number of times the link is clicked.
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "style": { "display": "=if(@currentField == '' , 'none' , '')" }, "children": [ { "elmType": "div", "customRowAction": { "action": "setValue", "actionInput": { "ClickCount": "= [$ClickCount] + 1" } }, "children": [ { "elmType": "a", "style": { "text-decoration": "none", "padding": "5px 10px 5px 10px", "font-weight": "bold", "border-radius": "5px", "font-size": "13px", "white-space": "nowrap" }, "txtContent": "@currentField.desc", "attributes": { "href": "@currentField", "target": "_blank", "class": "ms-fontColor-themePrimary ms-bgColor-themeLighter ms-fontColor-white--hover ms-bgColor-themePrimary--hover" } } ] } ] }
You need to have the ClickCount column visible in the SharePoint form for the JSON to work:
You could then have a flow to update a different list with the monthly totals and reset the number column to 0.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
4 Replies
- Rob_ElliottBronze Contributor
RMDUser1 I was just looking at a list I created a couple of years ago and realised that what I did with JSON formatting could go some way to answering your question.
In the example below I have a hyperlink column called Link and a number column called ClickCount. When the user clicks the link it opens a document from a library. You can format the Link column in advanced mode with the following JSON which will add 1 to the number of times the link is clicked.
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "style": { "display": "=if(@currentField == '' , 'none' , '')" }, "children": [ { "elmType": "div", "customRowAction": { "action": "setValue", "actionInput": { "ClickCount": "= [$ClickCount] + 1" } }, "children": [ { "elmType": "a", "style": { "text-decoration": "none", "padding": "5px 10px 5px 10px", "font-weight": "bold", "border-radius": "5px", "font-size": "13px", "white-space": "nowrap" }, "txtContent": "@currentField.desc", "attributes": { "href": "@currentField", "target": "_blank", "class": "ms-fontColor-themePrimary ms-bgColor-themeLighter ms-fontColor-white--hover ms-bgColor-themePrimary--hover" } } ] } ] }
You need to have the ClickCount column visible in the SharePoint form for the JSON to work:
You could then have a flow to update a different list with the monthly totals and reset the number column to 0.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)- RMDUser1Brass Contributor
Rob_Elliott thanks! This actually may work fairly well for us as a quick snapshot of the activity! Thank you!
- JoseuloCopper Contributor
You’re right — SharePoint doesn’t offer direct download tracking out-of-the-box. However, combining Power Automate with audit logs or file metadata can help, though it’s not completely automatic unless you're using premium connectors or custom scripts. I faced a similar issue on another project (though totally different field — we were setting up something for https://maagistv.com) and ended up using PowerShell to pull logs periodically into a report. Hope that helps point you in a useful direction!
- Rob_ElliottBronze Contributor
There's nothing that you can really do for this with Power Automate. It doesn't for example have a trigger "when a file is downloaded" so it can't tell when a file has been downloaded.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)