How to add string value to data column?

Hi,

I have an activity to do below :

I’m processing a date from number to text (2022-06-06 to Jun-22) and I store it in a variable called strMonth :

image

I want to make the value of each month into columns (like tranpose from row to column) and this is what I do :

image

strMonth is String, col_Month is datatable. When I tried to write line the value of Col_Month with for each row like below, it’s not showing anything :

image

Tried with col_month.rows.count and the value is 0

what did I do wrong? Can any1 help?

what Do you want to Count columns or rows?

Hi @Rhys18 ,

The Add Data Column Activity is used to add the Columns and not the Column Values.

Maybe by Debugging and Checking out the Contents of the Datatable you’ll be able to understand the populated columns as per your process.
or
Just to Inspect, you could use a Write Line Activity and Check out the number of Columns that you have added to the datatable like below :

DT.Columns.Count.ToString

Also, If you could explain what is yout Input data and How you would want the Output to appear, we could provide you with better suggestions to achieve it. Screenshots/Files would be helpful.

Hi @supermanPunch @sb001

I solved it myself about 15 minutes ago…

So my build data table must have a value, and when write to data table, exclude headers MUST unchecked or else my expected value is not coming out. Here’s my expected value :

Month is header, test123 is the value of the data table (the months on each column is as expected) but how to remove the column1 column 2 and the value Test123. Maybe can be helped?

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