cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ErikPrimozone
Frequent Visitor

Creating a flow that counts the uploads made by each unique user

Hello! There's some fluff leading up to my actual question, which is highlighted in green.

The background

We have a Sharepoint library that absolutely must not exceed the 5000 file limit. Still, we occasionally have instances where users upload seemingly small folders that actually contain hundreds of files, which either break or fast approach the limit. 

 

The solution

I would like to create a flow that warns a user by email if they upload more than 50 files to this library in less than one hour.

 

The progress so far

I've made a Flow that triggers once every hour, and then goes into an If statement if 99 files or more were uploaded within that hour. I've made a For Each loop that looks at each upload and checks the Microsoft account who is the author.

 

What remains

Now, I want to see if one specific user is responsible for more than half (50) of those 99 files. This is where I'm stuck. Is it possible to create an abstract dictionary of some sort, which keeps track of the number of uploads by each unique user? If so, I know the steps ahead to send an email to that person.

 

I'd really appreciate the help! 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @ErikPrimozone ,

 

Yes, it could be achieved, the steps for your following flow:

1. get all the 99+ files, apply to each file, check the file creator and save the creator emails to an array variable, use the union function to make sure the emails in the array is unique with no same emails.

2. Apply to each of the emails Array, filter in the 99+ files for creator equal to the current item of the emails array, use length expression to get the number of files created by the email.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-alzhan-msft
Community Support
Community Support

Hi @ErikPrimozone ,

 

Yes, it could be achieved, the steps for your following flow:

1. get all the 99+ files, apply to each file, check the file creator and save the creator emails to an array variable, use the union function to make sure the emails in the array is unique with no same emails.

2. Apply to each of the emails Array, filter in the 99+ files for creator equal to the current item of the emails array, use length expression to get the number of files created by the email.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,303)