Excel is Empty but DataTable output is blank when queried for rows count

Hello Everyone,

I am trying read excel(stored as dt3) as a part of my automation process which has lot of steps. The Excel sheet is empty which is working as expected but when I try to get the dt3.rows.count in the message box, it is displaying blank message output. Actually I need to check this condition in “If” block, but it isn’t working

What can be the issue here? Datatable rows count is blank and Excel sheet is empty. Shouldn’t it be “0” or “1” based on headers property. but why is it blank?

Thanks
Selva

@Selvasathappan
dt3.rows.count will come as an integer value.

If you want to use the if condition.
dt3.rows.count>0

i think, datatable is not generating

@hemanth_chinna @rajsekhar - Thanks for your response. Am still working on that issue but then I also have another issue and can u please advise me on this? I know to add a new column with default value but how do I handle the below scenario

@hemanth_chinna @rajsekhar - Can guys please advise me on this?

you can use generate data table , there define deliminater in the properties

But it only accepts a string as an input. You are asking me to read all the rows one by one and feed it as input Generate datatable activity? If yes, a) Will it not be a cumbersome approach b) How do I provide the row value in the “Input” field under properties of Generate datatable activity.

ok, text file directly we can pass to generate data table if you have input as a datatable then convert to text using output data table

Thank you Rajsekhar, can you please help me with the below issue as well?

I thought I fixed it but the format seems to be an issue. Can you please let me know how to merge datatable? I know the syntax and surce/destination tables but when I merge it the view column is in 2nd position but it starts from 4TH row

steps:
build data table dt for only headers

read range generates datatable dt1
add data column view to dt1
loop
assign view values till last row

finally
write range headers dt
then append the datatable dt1

Hello Rajsekhar,

Thanks for the response. Will try your approach and update you.

However Can you please shed some light or guide me on how to approach this?

better to create a macro for these type of activities

Hello @rajsekhar ,

Can you please help me with this?

please try to connect the CSV file as database connection

@rajsekhar - Thanks rajsekhar. I changed the delimiter to “;” and it started working. Quite weird but it was working. might be a bug. Can you please share your thoughts on the issue below?

@rajsekhar - Can you also please help me with this?