Reading a column starting from a specific cell

Hello All,

I want to read a column starting from the First Value Till the last non empty cell in that column.
I have user Read column but when the column contains only one value in the begining it is not taking it into account.
Any suggestions Please!
Thanks in advance

Can you screenshot the workflow?

@teyssir1,

  1. Read the entire data in the sheet and store the values in data table
  2. Get the row count of the data table using datatable.rows.count and store in a variable
  3. Then use read column passing the range dynamic as “A2:A” + variable.tostring

Thank you for you answer ,
I want to use each variable of that column.
i user for each item in ReadColumnOutput, and uset a log message to print the item but it is giving me a wrong value

You mean, is it writing the value of different index or a value which doesn’t exist?

read column (from D2 to dt.rows.count)
for each (item in ColumnOutput)
type into (item.tostring).

it is giving me the name of the column

Can you post the screenshots of your excel and the workflow how you are looping?

1 Like

PhoneNumbers is the Output of the Read Column Activityphone

Can you please change the read range activity range from “A1” to “” which will read all the data and then check @teyssir1?

I got Always the saùe result ( the name of the column)

Attach the workflow and excel , will check and let you know :slight_smile:

Config.xlsx (9.8 KB) test.xaml (81.5 KB)

Hello @teyssir1
Just check once you are selecting correct file in Excel application scope

  • Then Check you are Reading correct sheet in Read Range also In the Read Column.

I have checked and i am using the same sheet name and i am selecting the correct file.
i am always getting the name of the column as output

You have a row in the excel which is other than the column name @teyssir1

Can you try to iterate only the phone numbers variable by removing all the attach window activities inside?

And why don’t you use for each row activity to do the same? you can get the values in that by passing as row(“Phone numbers”).tostring

@teyssir1
In Read Column we have to provide only Starting cell so after that it takes the whole Column. Because you are using Count in Read Column It is taking all Columns After D according to Count. So Remove that Count and provide Range as only “D1” In Read Column.
I hope this will work for you.

1 Like

Why are you reading the range and the column ?

Use read range only and replace “A1” to “” --> if you just need column A

use for **each row ** and not a for each

replace item.tostring replace to row(0).tostring

you will get your results

Thank you for your answers , it works with the for each row !

1 Like

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