Bulk Add Queue Items - Extra Null Values getting uploaded

Hi All,

I am uploading a simple excel sheet with one column having integer values.
I am running a dispatcher process where I am fetching excel data and storing it in a datatable and using Bulk Add Queue Items to upload the datatable on orchestrator.
A lot of extra transactions are getting added with null values in the one column present e.g. while uploading 7500 rows, extra 2500 rows got uploaded with null values in content.
It is random in many dispatchers execution.

What could be the reason for the same?

1.Ensure that there are no empty rows at the end of your Excel sheet. If there are empty rows, the Read Range activity might be reading these rows, resulting in null values in your DataTable. Make sure that you limit the range to only the rows that contain data.

2.Before using the Bulk Add Queue Items activity, you should filter out or handle null values in your DataTable. You can use LINQ or other methods to remove or handle rows with null values before adding them to the queue.


1 Like

Sure, I will try it out.

Thank You.

visually an Excel can look empty
But within a deeper analysis there can be scenarios like present " " (space) within the cells

We would recommend the following:

  • Cleanup the datatable after read range with the help of:
    • Filter DataTable
    • a LINQ Statement
1 Like

A Cleansing LINQ, checking a paticular datatable column and removing blanks could look like this:

Assign Activity:

dtCleansed =

(From d in dtData.AsEnumerable
Where not isNothing(d("YourColName"))
Let cv = d("YourColName").toString.Trim
Where not String.IsNullOrEmpty(cv)
Select r = d).CopyToDataTable

For the unhappy case that all rows are empty we would defensive handle like:
:ambulance: :sos: [FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum

We can also adapt the LINQ and add more checks on it

1 Like

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