When I use Get files (Properties only), I can set pagination to 5000 and use Top count 5000, this setting let me get item properties larger than 5000. It works fine.
However, after that, I may need to use Apply to each to do some actions, then Apply to each will have view limit error. How can I deal with the Apply to Each 5000 limit? It seems there is no pagination feature
Solved! Go to Solution.
Hey @TYu036
Not sure you were looking for this only.
You can use a do until loop for this. Providing you a link to take reference from:
https://www.tachytelic.net/2020/04/get-more-5000-items-sharepoint-power-automate/
Hey @TYu036
Not sure you were looking for this only.
You can use a do until loop for this. Providing you a link to take reference from:
https://www.tachytelic.net/2020/04/get-more-5000-items-sharepoint-power-automate/
Hi Sundeep,
Many appreciated the information you provided. I tried the loop once before based on another blog but reject because of the speed performance problem. But in the blog you provided, it provides another API way to improve the speed performance. I will have a try and post back the result.
Hi Sundeep,
I think the solution should work. but to save my time, I use another workaround to meet my specific need. Anyway, thanks for the information you provided! This may help me in the future as well.
@TYu036 It would be interesting to see why you would need to loop over more than 5000 items. Often there are other ways to architect the flow to achieve what you're after without even needing a loop.
Would you be able to share what you were trying to do? Ok if you don't want to 🙂
On a side note - Apply to each can loop over more than 5000 items. I'll do some research and let you know the max limit. I just did a quick test and looped over 5,997 items without any issues. To speed up the Apply to each you can go into Settings and turn on Concurrency Control and set the Degree of Parallelism to have it run multiple threads. Note that this isn't always recommended such as when you are updating items in a list, etc.
Hi Grantjenkins,
Thanks for the reply.
What I want to do is to send email to every user whose files meet specific conditions.
The initial way I used is to:
Finally I use another way to deal with the problem. That is, to use select to create an array only with user email address, then use union() function in compose, remove duplicate user email address, because the user email address will not be more than 5000, then I can do anything I want with it.
I don’t know whether compose can have different result. But if you use “get file properties” or “condition”, the apply to each will give 5000 limit error.
Normally if you're having to loop across more than 5000 items there's another way to approach it - which is what you've done here. Very nice solution in the end 🙂
Just a quick question - are you sending a list of all the files affected for each person in the email too? If not, but you wanted to, you could potentially use some XPath to extract the file names for the person, joined by <br> very efficiently so they show up as a list of files.
Is this html code? I am not good at coding. So I use "create html table" action to do that. Then put the outputs to email content.
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
127 | |
54 | |
38 | |
24 | |
21 |