for loop of widget - API.getAllRecords

for loop of widget - API.getAllRecords

Hi,
so i have a widget and i need to get all the records of my report - more than 200.
so i can call getAllRecords twice, because each time i get a 200-records page.
if i don't know how many records i have, i need to use a for loop of records and loop as long as the returned page Size is 200.

but this creates a lot of problems  and doesn't work because getAllRecords is Async method.
it runs in another thread.
so...

how can i combine all records of my report from different getAllRecords API calls?

    Zoho Pagesense Resources

        Zoho SalesIQ Resources



              Zoho TeamInbox Resources

                Zoho DataPrep Resources


                    Zoho CRM Plus Resources

                      Zoho Books Resources


                        Zoho Subscriptions Resources

                          Zoho Desk Resources

                            Zoho Projects Resources


                              Zoho Sprints Resources


                                Qntrl Resources


                                  Zoho Creator Resources


                                    Zoho WorkDrive Resources




                                        Zoho Campaigns Resources

                                          Zoho CRM Resources

                                                      Design. Discuss. Deliver.

                                                      Create visually engaging stories with Zoho Show.

                                                      Get Started Now