2 string variable from 2 different column to populate a single output column in CSV

My two variable string type which will grab the data from the excel column below:

ME1_POWER = DT_file5_data(i)(“ME1.POWER”).tostring()

image

ME2_POWER = DT_file5_data(i)(“ME2.POWER”).tostring()

image

After that I would do below activities:

Where NewRow is a datarow type

NewRow = DT_File5_Output.NewRow()

But my output only write the ME2_POWER, and I think it overwrite the ME1_POWER.
image

My desired output is supposed to have both data from both column under the same new column:
image

I am not sure what I did wrong here, can anyone assist me?

@Irfan_Musa,

Move this assign activity below Add data row activity and add one more add data row activity below it.

Thanks,
Ashok :slightly_smiling_face:

@ashokkarale its giving me error when I do that

@Irfan_Musa,

Take the New Row assign activity also below Add data row.

I mean make a copy of the New Row assign activity.

@Irfan_Musa

You have to do the seuqence of new row,assign and add data row twice …once for each value you need

Cheers

I did them like this, is this what u meant?

The image depicts a sequence of actions in a workflow, illustrating steps to initialize a new row, assign values ME1_POWER and ME2_POWER to the "MCR_load" field, add the new row to the data table DT_File5_Output, and repeat the process. (Captioned by AI)

The image shows a workflow automation process that assigns a value to a data row, adds the data row to an output data table, and writes the final filtered data to a CSV file. (Captioned by AI)

I did them like this, is this what u meant?

The image depicts a sequence of actions in a workflow, illustrating steps to initialize a new row, assign values ME1_POWER and ME2_POWER to the "MCR_load" field, add the new row to the data table DT_File5_Output, and repeat the process. (Captioned by AI)

The image shows a workflow automation process that assigns a value to a data row, adds the data row to an output data table, and writes the final filtered data to a CSV file. (Captioned by AI)

@Irfan_Musa,

This way please.

Thanks,
Ashok :slight_smile:

@ashokkarale The output seems different compare to the one I want

image

My desired output is supposed to have both data from both column under the same new column:

image

It has to populate the ME1_POWER first in the row than the ME2_POWER

@Irfan_Musa,

Ohh ok. I think we need to change the approach here.

Use two datatables one for ME1_Power and one for ME2_Power

Once data is filled in these, just before write range, use Merge datatable activity to merge both and then write the final combined output using Write Range

How do I create the data table. Currently my ME1_POWER and ME2_POWER are string type

Like dt_File5_Output