Performance issue while downloading more than 2 thousands of records in Excel

Hi Team, I am facing performance issue while downloading excel report as we have 7-8 thousands of records but after adding some filters getting 2 thousands objects to download. Now it is taking several minutes to download report in app.  Here is screenshot of my microflow where loop is iterating more than 2 thousands times to get associate with Doc(system.document) entity: Is there any way to make it faster like using OQL Module or JavaAction? If OQL, then can we create object and associate with other entity using OQL? if JavaAction, then how could I achieve this?   Thanks!
1 answers

The performance will probably mainly been eaten by the loop. Replacing the retrieve with an OQL will therefor not make much of a difference. First thing to try is to download as CSV.