Adding Data Column


#1

Can anyone help with how to add data column for an existing data table and also add the dynamic data into that specific data column.


#2

you can use add data column activity to add new column to a datatable.
while creating only you can specify the default value.

if you need to add dynamic data, you can update column using row condition


#3

How can we use a row condition, can you explain in detail. As I am unable to process this.


#4

Hello @Sangeetha_Harika

You can use as image below:


#5

As per your advise I have tried and getting an error. can you please check the below image and let us know


#6

Hi Sangeetha,

Can you provide exception full log and also the the steps you following.

Thanks
Venkat


#7

@Sangeetha_Harika

Can you share your flow?


#8

Hello Venkat,

I am trying with some data in the data table and wants to add status of the data in other column.

For example, we are checking with the Booking numbers and we want to know whether it is cancelled or confirmed.
column 1 Column2
Booking Numbers Status
3456 Cancelled
1234 Confirmed
5678 Cancelled

Right now we have the booking number is existing data table and now we want the column and update the status one by one at the time of execution.


#9

Hi Sangeetha,

Okay. I hope the data type of columns is string.
When I saw your screenshoti suspect it’s not related to datatable
Can you share the exception stack trace and xaml file if you can…


#10

@Sangeetha_Harika

You can try this by invoke code
dt.Columns.Add(“Column Name”, GetType(String))

For eah row as Data Row In dt.rows

if row("Column2’’).tostring.trim.equals(YOUR CODITION) Then

row(“Status”) = yourNewUpdate

end if

Next row


#11

Thanks @dkollyns, I think it works. Let me try.

Sorry @venkat4u, I cannot share the work flow or the file.


#12

Can you explain why you have used trim function in for each data row


#13

Hello @DIVYA_VUNJALI

To remove the space


#14

Here, we are checking whether the booking is cancelled or not and want to add one more column to Data1 and update the status. Please check the below Xaml file and also the Excel file.

DataColumn.xaml (9.5 KB)

Test1.xlsx (7.6 KB)


#15

Ok, I’ll check, but case the booking is cancelled or confirmed what do you do?


#16

We check with third parties on their site and then update in the excel file to get the exact report of number of bookings cancelled and confirmed.


#17

@Sangeetha_Harika
@DIVYA_VUNJALI

Please check the attachement
DataColumn.xaml (15.6 KB)
Test1.xlsx (8.9 KB)

I believe you need get the number of your third and check with you excel file.

See the example attachement