Output Excel only shows headers after merging and filtering DataTable

Hi,
I created a workflow that reads multiple Excel files, merges them into one DataTable, applies a filter, and writes the result to an output file.

Problem:
The output Excel only contains the column headers, but no data rows.

  • Using Read Range Workbook with AddHeaders=True and blank range.
  • Merging dt_Input into dt_report, then filtering into dt_Filteredreport.
  • Writing dt_Filteredreport to the output file.
  • Input files contain data

workflow:


output(only headers):

Expected output:

Hi @Keerthana06

It can be the case that during the merge/filter, data is getting lost/filtered.

I would suggest to run process in debug mode, put breakpoints at different merge activity and filter activity.

And then review the datatable variable in each of those activity from locals panel.

That way you will be able to find out where data is getting lost.

Hope this helps.

Regards
Sonali

@Keerthana06

Also, what does your dt_input and dt_report contain?

Output of read range is dt_input?

If yes, then what does dt_report contain?

dt_report is a master DataTable where all dt_Input tables are merged

1 Like

@Keerthana06

Ok, please try debugging, that will allow you check datatable output after each merge and filter

@Keerthana06

Mostly filter is removing the data from it..simply use a log message in your second for loop mostly it is not running at all as there is no data

Either run in Debug and check locals panel or add a log message with dt_report.rowcount before and after the filter activity

Alao please check the scope of dt_report if it is inside for then it will be reintialized always and previous data would be lost

Cheers

*Added log messages before and after the Filter DataTable:

  • dt_Report` rows before filter = 10
  • dt_Report` rows after filter = 10
  • Added a log inside the second For Each, but nothing was printed, so the loop isn’t running.
  • Checked the variable scope for both DataTables – it’s set to Sequence.

From this, it looks like dt_Report has rows, but dt_filteredReport is coming out empty, so the second For Each doesn’t execute. The issue might be with how the Filter DataTable outputs to dt_filteredReport or the filter condition itself.

@Keerthana06

okay I missed it yes dt_filteredreport is what is to be checked as that is whst is being written and as expected as for loop is not runnign filter is not working..check the same

cheers

I ran the workflow in Debug mode with breakpoints and watched the DataTables in the Locals panel just like you suggested.

  • dt_Report stayed at 10 rows before and after the filter.
  • Discovered dt_Filteredreport was empty at first, which stopped the second For Each.
  • Fixed the filter condition and now it’s returning 3 rows and running perfectly.

Big thanks for the tip – the Locals panel turned out to be a real data detective tool and solved the mystery!

1 Like

Yes, you were right – I checked dt_Filteredreport and it was coming out empty, which is why the second For Each wasn’t running. After correcting the filter condition, it’s now returning 3 rows and the loop runs perfectly.

Thanks for pointing me in the right direction! Cheers!

1 Like

@Keerthana06

Glad it helped

Happy Automation

cheers

@Keerthana06

Glad to know it helped:)

Locals panel - detective panel :smile: I like it :slight_smile:

Now that your issue is solved, kindly consider marking the post that helped as a solution so this topic can be closed.

Regards
Sonali

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.