Assign a specific range to a variable of a data table type with assigned activity

How to assign a specific range like “A1:W1” to a variable of a type data table with assigned activity?

is it possible?

without converting the data table type

Give an assign activity and use the type as string suppose your variable is range of type string

assign
range = “A1:W1”

Regards

Hi @kalmajhad

Give like this

In FilterExpression give “A1:W1”

dtFilteredData = dtExcelData.Select(“FilterExpression”).CopyToDataTable()

@kalmajhad

Assign activity:

Assign activity:
dtSpecificRange = (From row In dtFullRange.AsEnumerable()
                  Select row.ItemArray.Take(23).CopyToDataTable()).CopyToDataTable()


dtSpecificRange will hold the first row of dtFullRange (columns A to W). Adjust the number 23 in the LINQ query to match the number of columns you want to include in your specific range.

Regards

Hi @kalmajhad

Take an assign activity and create an variable string datatype.
And initialize the “A1:W1”

- Assign -> RangeVariable = "A1:W1"

Pass this variable to the range field in the activity.

Hope it helps!!

no, I don’t want to specify the range in the read range I need to read the whole table then I need a specific range to use for another activity

Hi @kalmajhad

Try this

image

Hi @kalmajhad

image

Did not work “Copy to data table” did not appear

Error syntax error “Missing operand after :W1 operator”

Any suggestion? Still stuck.