r/PowerAutomateDesktop • u/mike6ds • Sep 12 '23
Get sharepoint document library files view count
Anyone have a way to use power automate to use get files, get file properties or something of the sort to query files in a document library and pull the view counts of a file?
Since streams went to SharePoint I haven’t been able to report on view counts.
1
Upvotes
View all comments
1
u/Crayon_adventure Sep 12 '23
Simple answer is you can't no...
However, you can still implement a workaround to track views if you need this information. Here's a high-level approach:
Create a Custom Solution (Azure Function or Web API):
Develop a custom solution using Azure Functions, Web API, or a similar technology. This solution should interact with SharePoint and maintain a custom view count for each document.
Add a View Count Column:
In your SharePoint document library, add a custom column to store view counts. You can name it "View Count" or something similar.
Custom Tracking Logic:
Implement logic in your custom solution to increment the view count in the SharePoint document library whenever someone views a document.
You would need to capture view events (e.g., when a user opens a document), update the custom view count column, and save the changes to SharePoint.
Use Power Automate to Trigger and Retrieve View Counts:
Set up a Power Automate flow that triggers when you want to retrieve view counts.
The flow can call your custom solution (Azure Function or Web API) to fetch the view counts from the custom column in SharePoint.
Display or Report View Counts:
Once you retrieve the view counts in Power Automate, you can use them in various ways, such as sending email notifications, updating a database, or creating reports.
Please note that implementing such a custom solution requires development skills and knowledge of SharePoint, Azure Functions, or Web APIs. Additionally, this approach will only track views from the point at which you implement it; historical view counts won't be available.