Callback value from for loop

Hello everyone, I kindly assist for your help on something that has taken me too long and still no solution.

My problem is this. I have created a python dash application and the result is that based on user input, I create a docx file for the user to download. That docx is a template where each page is based on one user input. ( 2 user inputs 2 pages etc). When the user input is big that docx takes some time to be generated so in the meanwhile I want to show the generation progress on a dcc.progress component. In order to generate the docx I use dcc.send_file(function_name) where the function name is the one creating and returning the docx. In order to get the progress value, I have to somehow return the iter of the for loop that appends the docx. My problem is, how can I return that iter? I was thinking on creating a global variable and changing that but in production this will raise errors. Can you suggest me anything else? Maybe another way to have a global variable but specific for each user? Thank you!

Hi @Ntinoctheo welcome to the forums.

Does this help?