Error: There is No row at position 0

Hi Community,

I was wondering if you guys could help with the following error. My process was working fine but I have found this error.


Can Anyone help with this.? Thanks

Hi,

This error shows your datatable has no row. Can you check content of your datatable?

Regards,

@Yoichi

Thanks for the swift response

Here is the partial of the process

It is read from the excel file first and the above steps follows

Finally, we create the csv files

Hi,

I guess the excel sheet (Sheet1 of EmployeeTemplate) is empty (or there is no rows except header). Can you check it?

Regards,

Yes, that is a template, has no values in it. We want the csv to mirror that format. Please let me know if there is more information you need

@Yoichi

It is based on this
7zO872CDEF1.zip (90.5 KB)

HI,

There are some ways to solve this. Can you try either of the following?

  1. Indicate specific range in ReadRange

    EmployeeTemplate.Sheet(“Sheet1”).Range(“A1:T2”)

  2. Add “AddDataRow” activity

PS. There seems mis-configuration in your dictionary. It’s also necessary to fix.

Regards,

Regards,

1 Like

@Yoichi

image (28)

Found this one

Hi,

Which activity has this error? Does this exist in the above sample you attached?

Regards,

Hi

When I add data row the error appeared. However, when I wrote in the fields and removed and saved and ran. It’s worked fine. I’ll get back to you once I see Test yours, the firs scenario

@Sisay_Dinku
try this
7zO872CDEF1-2.zip (117.8 KB)
example result:

@Yoichi, thanks a lot. The first option worked fine. I have a follow up question though: When I see my CSV in the text editor, there are blanks spaces that I do not need. The CSV files I just created are going to be employed by another process, therefore, the extended unnecessary blanks spaces are not needed. How do I get rid of them? I was trying to restrict by read range from A1: G4 (A1:V1, A2:V2, A3:V3 and A4 :G4) for example. Please see the following screenshot—>>
Also, the numbers preceding with zero are truncated, we do not want them truncated.

Hi,

It seems empty string and probably it won’t affect any problem, I think.
However, if you need to delete these, can you try as the following?

image

strCSV.TrimEnd.TrimEnd(","c)

Also, the numbers preceding with zero are truncated, we do not want them truncated.

Can you try to set cell format as Text in the template sheet, in advance?

Regards,

@Yoichi

My process is expected to create thousands of csv files. Therefore, once they are created, I do not handle them. I just wanted if there are ways in which we can remove the empty strings and then the files are created. Please let me know if you need more information.

As the format cell activity beforehand for the 0 values, it did not work.

Thanks

HI,

Give it a try to use OutputDataTable and the above logic instead of WriteCSV, as the following.

image

As the format cell activity beforehand for the 0 values, it did not work.

Can you try preserve format option to read range? Next set format as text, then write it to the sheet.

And as these things are apart from title of this topic, perhaps you should raise a new topic because it will help those who face same issue.

Regards,

@Yoichi

Is preserving format in the modern design?
and the format cell set as text
and then write to cell

HI,

DisplayValue is fine in Modern. Give it a try.

Regards,

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