UiPath DataTable blank rows after Add Data Row

Hi everyone, I have a DataTable with 15 columns. When I process a small batch of emails (10–50), everything works perfectly and the Excel output has no blank rows. But when I process a larger batch (80–120 emails), the DataTable reaches around 160+ rows (expected), but many of those rows are completely blank or only contain the “Body” column. I added logs: - DataTable starts with 0 rows. - Every Add Data Row increments a counter correctly. - Before exporting, the DataTable has e.g. 167 rows. - But the Excel contains a mix of valid rows and a large number of empty rows. I also added a debug column “OrigenFila” at the end. Valid rows fill this column correctly (e.g., ‘OCV2-PDF’ or ‘OCV2-XLSX’), but blank rows have NO value in that column, which means they are created by some Add Data Row that I have missed. The issue only appears with large volumes. With small datasets everything is correct. Any idea why Add Data Row might be adding blank rows only with certain inputs? Could it be a Switch Default, a DT mismatch, or an unexpected attachment type? Thanks!

Hi @Alejandro_Gonzalez_Romero

You mean datatable has all data as expected but when you write that datatable into excel, you see a lot of empty rows added as well?

Hi @Alejandro_Gonzalez_Romero

Add a condition before Add Data Row (e.g., check If Not String.IsNullOrEmpty(Body)) so the row is added only when valid data exists.

Happy Automation.
AJ

Hi again, Let me clarify the exact behavior of my workflow so you can better understand the issue. The robot reads emails from a mailbox (Microsoft 365 activity). For every email, it processes all attachments. For each attachment, the workflow is supposed to create one row in a DataTable, and later export it to Excel. • Columns A–E come from the email (From, To, Date, Subject, Body). • The file name goes in column F (if the attachment is Excel) or column G (if the attachment is PDF). • All rows are created through Add Data Row inside a Switch that checks the attachment extension. When I process small batches (10, 20, 30, even 50 emails), everything works perfectly: - All attachments generate their rows correctly. - The Excel file is complete and consistent with the number of attachments. However, when I process a large batch (around 100+ emails), the workflow suddenly stops adding the rows: - The resulting Excel file contains only the column headers, with no data rows. - This only happens when processing a large number of emails. - With the exact same workflow and settings, smaller batches still work fine. So the issue is not with reading the emails or with the Excel activities — it is that the DataTable simply does not receive any rows when the input volume is high, even though the logic for each attachment is the same. This is why I suspect something related to how the attachments are being processed under load, or how the invoked workflow that generates the final filename is returning its Out argument when there are many iterations. Any ideas or similar experiences would be greatly appreciated. Thanks!

Hi @ajay_Kumar13, Thanks for the suggestion. I actually tried adding a condition before every Add Data Row (for example If Not String.IsNullOrWhiteSpace(strNombreFinalAdjunto) and also testing the Body field), but the behavior is the same. With small batches of emails (10–50), the rows are created correctly and the Excel output looks fine. But when I process a larger batch (80–100+ emails), the workflow does not populate the DataTable correctly: either the Excel comes out completely empty (headers only) or it only writes a few rows where the Body column appears but all other columns (From, To, Date, Subject, FileName) are blank — similar to the screenshot I attached. So it seems the issue is not solved by simply checking for empty fields before adding the row. Something else happens only when processing large volumes. Thanks again for the help.

Hi @Alejandro_Gonzalez_Romero

Thank you for sharing details.

Just to confirm - you are exporting data to excel in one go in the end, right? Adding datatable instead of exporting datarow each time ?

Also, could you try printing the contents of your datarow before adding it into the datatable to check if anything is added in the datatable or not.

You can use String.Join(“,”,datarow.itemarray) to print the datarow at once.

This way, you will be identify if anything is actually being added to the datatable or not. If nothing is added in here, then can be the case that values are not being fetched from email attachments and can try by adding some delay in there.

If it’s being added to the datarow, then you might need to check the login of adding in datatable or exporting to excel.