shrayud
(Shrayus)
March 9, 2021, 9:38am
1
Hi,
I have 1 DT. With the below columns :
SlNo,TRANSACTION_ID,PNR_NO,CLIENT TRANSACTION ID,BOOKING_AMOUNT,PG NAME,CLASS,TRANSACTION_DATE,USER_ID,PRINCIPAL_USER_ID, AMC_Charge(Including GST).
I want to introduce a new Column(CLIENT TRANSACTION ID + BOOKING_AMOUNT) in the data table. This is equivalent to =CONCATENATE(CLIENT TRANSACTION ID, BOOKING_AMOUNT) in excel.
I am new to Uipath. Please help.
@shrayud
Pass the new column name and Datatable name
shrayud
(Shrayus)
March 9, 2021, 9:51am
3
Hi,
I am aware of this activity. Can you explain the working with this? I mean how to concatenate the columns?
@shrayud Create new data table DT2 and use DT2=DT1.clone
Then add a new column to DT2 and then iterate through DT1 and add a data row to add all the values from DT1 with new column values
shrayud
(Shrayus)
March 9, 2021, 10:55am
5
Hi , Tried the same. PFA .xaml file.
Please know that this is taking lot of time to execute. I have files of 18K rows. Can you please optimise it?
test_concatenate.xaml (7.1 KB)
ppr
(Peter)
March 9, 2021, 11:36am
6
@shrayud
have a look here, especially for the second part. It has the potential to avoid a for each run for setting the value for the newly added datacolumn:
@PeruT
it can be achieved while configuring the custom datascraping:
start Datascrapping Wizard
indicate first cell
click no for
configure first column (indicating firdt and second cell)
click on extract correlated data
indicate first cell Company column
configure:
[grafik]
click on extract correlated data
click on first link, second link, configure:
[grafik]
get:
[grafik]
and so on
Kindly note to enhance the retrieved link withe base url info:
retrieved: market-activity/ipos/o…
so in your case:
Add datacolumn activty
assign activity
#leftside: yourDataTableVar.Columns(ColNameOrIndex).Expression
#right side: “CLIENT TRANSACTION ID + BOOKING_AMOUNT”
2 Likes
shrayud
(Shrayus)
March 9, 2021, 12:48pm
7
Hi peter,
I am new in UiPath. It would help if you can be a bit more descriptive. Thanks
songoel
(Sonal)
March 9, 2021, 1:01pm
8
Hi @shrayud ,
Try using the Add Data Column activity directly.
For this, you need to read your table from excel into a DT.
Use Add Data Column activity:
Specify properties column name, datatable name and object type(value type)
Now the data column is added.
To perform your action on this column, use for each row
For each row in Datatable
row.Item(“”) = “Your Value”
After the for loop, write range and don’t forget to add headers while writing it to excel.
ppr
(Peter)
March 9, 2021, 1:51pm
9
just go through the link for more details.
Your flow could look similar like this:
in your case:
Add datacolumn activty
assign activity
#leftside: yourDataTableVar.Columns(ColNameOrIndex).Expression
#right side: “CLIENT TRANSACTION ID + BOOKING_AMOUNT”
1 Like
Add column with name TRAN_ID_BOOKING_AMOUNT
Then use assign with below expression
DailyBookingDT.Columns("TRAN_ID_BOOKING_AMOUNT").Expression = "[CLIENT TRANSACTION ID] + BOOKING_AMOUNT"
Please find attached the sample flow for reference.
test_concatenate (1).xaml (5.9 KB)
4 Likes
Hi @shrayud
You can try invoke method for concatenating columns
check link
Hi, From where this datatable is populated, there itself you can try to populate the third column as well. Sorry if my understanding is not correct here. Let us know where you are getting the datatable dt1.
Regards,
Nived N
Happy Automation
You need to refer to the same column name in your Assign activity as in the Add Data Column activity:
Also, if your column name contains space(s), you need to surround it with square brackets.
So you Assign should look like this:
DailyBookingDT.Columns("TRAN_ID_BOOKING_AMOUNT").Expression = "[CLIENT TRANSACTION ID] + BOOKING_AMOUNT"
3 Likes
You forgot square brackets:
2 Likes
Updated in original comment… Thanks
1 Like
shrayud
(Shrayus)
March 10, 2021, 6:19am
16
This works fine. Thanks a lot everyone for helping out.
Just curious what is the logic of “[ client transaction id] > square brackets” ?
system
(system)
Closed
March 13, 2021, 6:20am
17
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.